vba怎么将一个大的excel文件
发布网友
发布时间:2022-08-15 13:10
我来回答
共1个回答
热心网友
时间:2023-09-15 16:22
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim wk1 As Workbook, sh1 As Worksheet, wk2 As Workbook, sh2 As Worksheet
Filename = Application.GetOpenFilename(fileFilter:="Excel File (*.xlsx), *.xlsx,Excel File(*.xls), *.xls", FilterIndex:=2, Title:="请选择文件")
If Filename = False Then
Else
Workbooks.Open (Filename)
Set wk1 = ThisWorkbook
Set sh1 = wk1.ActiveSheet
Set wk2 = ActiveWorkbook
Set sh2 = ActiveSheet
sh2.[a:a].Copy sh1.[a:a]
wk2.Close savechanges:=False
MsgBox "数据导入成功!"
End If