EXCEL合并工作表宏代码

Sub CombineWorkbooks()
Dim FilesToOpen
Dim x As Integer
On Error GoTo ErrHandler
Application.ScreenUpdating = False
FilesToOpen = Application.GetOpenFilename(FileFilter: = “MicroSoft Excel文件(.xls),.xls”,MultiSelect: = True,Title: = “要合并的文件”)
If TypeName(FilesToOpen) = “Boolean” then
MsgBox “没有选中文件”
Goto ExitHandler
end if
x = 1
While x <= UBound(filestoopen)
Workbooks.Open fileName: = filestoopen(x)
…….

您需要先支付 2元 才能查看(下载)全部内容!立即支付

赞(0)

评论抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址