合并多个EXCEL,公式问题?求高手!
Sub ModMergedTables() '合并工作表
Application.ScreenUpdating = False
MyPath = ActiveWorkbook.Path
MyName = Dir(MyPath & "" & "*.xls")
xlBookName = ActiveWorkbook.Name
Num = 0
Do While MyName <> ""
If MyName <> xlBookName Then
Set xlBook = Workbooks.Open(MyPath & "" & MyName)
Num = Num + 1
With Workbooks(1).ActiveSheet
xlBook.Sheets(1).UsedRange.Copy .Cells(.Range("A65536").End(xlUp).Row, 1)
xlBookNum = xlBookNum & Chr(13) & xlBook.Name
xlBook.Close False
End With
End If
MyName = Dir
Loop
Range("A1").Select
Application.ScreenUpdating = True
End Sub