Sub GrabMyData()
Dim myWB As Workbook
Dim thisWB As Workbook
Dim thisWS As Worksheet
Dim lastRow As String
Application.ScreenUpdating = False
Set myWB = Workbooks.Open("C:\Users\jjordan\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\GTER232\TEST.csv")
myWB.Sheets("Sheet 1").Range("A8:F17").Copy
Set thisWB = ThisWorkbook
Set thisWS = ThisWorkbook.Sheets("Sheet 5")
thisWB.Activate
lastRow = ActiveSheet.Cells(Rows.Count, "H").End(xlUp).Row
thisWS.Range("H" & lastRow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
With Application
.CutCopyMode = False
.ScreenUpdating = True
End With
myWB.Close
End Sub
答案 0 :(得分:0)
您是否尝试将 thisworkbook 更改为工作簿(“工作簿名称”)?