0
我試圖從一個工作簿到當前工作簿中的值複製,但我得到的錯誤:Excel的VBA運行時錯誤「13」類型不匹配
Run-time error '13' Type mismatch
我嘗試了很多,但沒有得到解決任何一個請幫我
Sub Update()
Dim sPath As String
Dim sValue As String
Dim wbTarget As Workbook
Dim strName As String
strName = ActiveSheet.Name ' Explicitly provide the sheet name
sPath = "C:\Users\nikhil.surendran\Desktop\1"
Set wbTarget = Workbooks.Open("C:\Users\nikhil.surendran\Desktop\3" & ".xlsx")
sValue = wbTarget.Sheets(1).Range("A1:B5").Value
ThisWorkbook.Sheets(1).Range("A1:B5").Value = sValue
ThisWorkbook.Save
End Sub
謝謝GSerg它的工作 – 2013-05-10 09:10:43