Application.ScreenUpdating = False FilesToOpen = Application.GetOpenFilename(FileFilter:="MicroSoft Excel文件(*.xls),*.xls", MultiSelect:=True, Title:="要合并的文件") If TypeName(FilesToOpen) = "Boolean" ThenMsgBox "没有选中文件"GoTo ExitHandlerEnd If x = 1While x <= UBound(FilesToOpen)Workbooks.Open Filename:=FilesToOpen(x)Sheets().Move After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)x = x + 1WendExitHandler:Application.ScreenUpdating = TrueExit SubErrHandler:MsgBox Err.DescriptionEnd Sub 追问: vb6.0还是VB.NET?带有excel的接口函数? 回答: 直接使用EXCEL中的VB编辑器就可以了,记得要新建一个模版哦
温馨提示:答案为网友推荐,仅供参考