Option Explicit
Sub Test()
Dim ABC As Workbook
Dim XYZ As ThisWorkbook
With Application
.ScreenUpdating = False
.EnableEvents = False
.DisplayAlerts = False
End With
Set XYZ = ThisWorkbook
Set ABC = Workbooks.Open("F:\Test\ABC.csv")
With ABC
.Copy After:=XYZ.Sheets(XYZ.Sheets.Count)
.Close False
End With
With Application
.ScreenUpdating = True
.EnableEvents = True
.DisplayAlerts = True
End With
End Sub
答案 0 :(得分:0)
用ABC .Copy After:= XYZ.Sheets(XYZ.Sheets.Count) 。关闭虚假结束
在上面的行中,ABC是一个工作簿,其中是ABC工作簿的工作表参考?
也可以使用工作表参考。
With ABC.Sheets("MySheet")
或者
With ABC.Sheets(1)