某文件夹内有若干个表,我想合并为一个表不同sheet
我的步骤为新建一个excel,alt+F11运行如下代码,这个代码包括合并和反序
Sub Find()
Application.ScreenUpdating = False
Dim MyDir As String
MyDir = ThisWorkbook.Path & "\"
ChDrive Left(MyDir, 1) 'find all the excel files
ChDir MyDir
Match = Dir$("")
Do
If Not LCase(Match) = LCase(ThisWorkbook.Name) Then
Workbooks.Open Match, 0 'open
ActiveSheet.Copy Before:=ThisWorkbook.Sheets(1) 'copy sheet
Windows(Match).Activate
ActiveWindow.Close
End If
Match = Dir$
Loop Until Len(Match) = 0
Application.ScreenUpdating = True
On Error Resume Next
For i = 1 To Worksheets.Count - 1
Sheets(1).Move after:=Sheets(Worksheets.Count - i + 1)
Next
End Sub
现在有几千个文件夹,我录了个按键脚本,但还是又慢又蠢,我如何同时对这几千个文件夹执行相同操作呢?
求详细方法,纯小白~~