sub 多表多檔案合并為多表一檔案()
dim filearray
dim x as integer
application.screenupdating = false
filearray = application.getopenfilename(filefilter:="microsoft excel檔案(*.xlsx),*.xlsx", multiselect:=true, title:="合并工作薄")
x = 1
while x <= ubound(filearray)
workbooks.open filename:=filearray(x)
sheets().move after:=thisworkbook.sheets(thisworkbook.sheets.count)
x = x + 1
wend
exithandler:
application.screenupdating = true
exit sub
errhadler:
msgbox err.description
end sub