|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub Macro1()
Dim MyPath$, MyName$, sh As Worksheet, m&
Application.ScreenUpdating = False
Set sh = ActiveSheet
MyPath = ThisWorkbook.Path & "\"
MyName = Dir(MyPath & "*.xls")
sh.UsedRange.Offset(1).Clear
Do While MyName <> ""
If MyName <> ThisWorkbook.Name Then
With GetObject(MyPath & MyName)
.Sheets("逆变器日报表").Range("a2:a20,m2:m20").Copy sh.Cells(2, N + 1)
.Close False
End With
N = N + 2
End If
MyName = Dir
Loop
Application.ScreenUpdating = True
End Sub
|
|