|
参与一下。。。- Sub ykcbf() '//2024.7.29
- Set fso = CreateObject("scripting.filesystemobject")
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("Sheet1")
- p = ThisWorkbook.Path & ""
- ReDim brr(1 To 10000, 1 To 100)
- For Each f In fso.GetFolder(p).Files
- If LCase$(f.Name) Like "*.xls*" Then
- If InStr(f.Name, ThisWorkbook.Name) = 0 Then
- fn = fso.GetBaseName(f)
- m = m + 1
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets("WX-5355-A1")
- arr = .UsedRange
- brr(m, 1) = arr(1, 1)
- For j = 2 To UBound(arr, 2)
- brr(m, j) = arr(2, j)
- Next
- End With
- wb.Close False
- End If
- End If
- Next f
- With sh
- .UsedRange.ClearContents
- .[a1].Resize(m, UBound(arr, 2)) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|