合并当前目录下所有工作簿的全部工作表

Sub 合并当前目录下所有工作簿的全部工作表() 
Dim MyPath, MyName, AWbName 
Dim Wb As Workbook, WbN As String 
Dim G As Long 
Dim Num As Long 
Dim BOX As String 
Application.ScreenUpdating = False 
MyPath = ActiveWorkbook.Path 
MyName = Dir(MyPath & “\” & “*.xls”) 
AWbName = ActiveWorkbook.Name 
Num = 0 
Do While MyName <> “” 
If MyName <> AWbName Then 
Set Wb = Workbooks.Open(MyPath & “\” & MyName) 
Num = Num + 1 
With Workbooks(1).ActiveSheet 
……

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

赞(0)

评论抢沙发

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