|
Option Explicit
Sub test()
Dim strFileName$, strPath$, Rng As Range, iRow&
Application.ScreenUpdating = False
strPath = ThisWorkbook.Path & "\"
strFileName = Dir(strPath & "*.xls*")
[A1].CurrentRegion.Offset(1).ClearContents
Do Until strFileName = ""
If strFileName <> ThisWorkbook.Name Then
iRow = Cells(Rows.Count, "A").End(3).Row + 1
With GetObject(strPath & strFileName)
With .Sheets("工地明细").[A1].CurrentRegion
Set Rng = Intersect(.Offset(), .Offset(1))
Rng.Copy Cells(iRow, 1)
End With
.Close False
End With
End If
strFileName = Dir
Loop
Application.ScreenUpdating = True
Beep
End Sub
|
评分
-
1
查看全部评分
-
|