环球动态:如何将excel工作表合并_excel工作表合在一起

时间:2023-05-20 20:54:37       来源:互联网


(资料图片)

1、Sub 合并工作表() Dim MyPath$, MyName$ Application.ScreenUpdating = False MyPath = ActiveWorkbook.Path & "" MyName = Dir(MyPath & "*.xls") On Error Resume Next Do While MyName <> "" If MyName <> ***.Name Then With GetObject(MyPath & MyName) .Sheets("newSheet").Copy After:=ActiveWorkbook.Sheets(ActiveWorkbook.Sheets.Count) End With End If MyName = Dir Loop Application.ScreenUpdating = TrueEnd Sub。

本文分享完毕,希望对你有所帮助。

关键词: