把多個(gè)工作簿中的工作表合并到一個(gè)工作簿中的vba代碼
2008-04-05 00:32
Dim FileOpen Dim X As Integer Application.ScreenUpdating = False FileOpen = Application.GetOpenFilename(FileFilter:="Microsoft Excel文件(*.xls),*.xls", MultiSelect:=True, Title:="合并工作薄") X = 1 While X <= UBound(FileOpen) Workbooks.Open Filename:=FileOpen(X) Sheets().Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count) X = X + 1 Wend ExitHandler: Application.ScreenUpdating = True Exit Sub
|
|