|
参与一下。。。
- Sub ykcbf() '//2024.6.28
- Set fso = CreateObject("scripting.filesystemobject")
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("Sheet1")
- sh.[a2:b1000000] = ""
- p = ThisWorkbook.Path & ""
- ReDim brr(1 To 500000, 1 To 2)
- For Each f In fso.GetFolder(p).Files
- If InStr(f.Name, ThisWorkbook.Name) = 0 Then
- fn = fso.GetBaseName(f)
- Set wb = Workbooks.Open(f, 0)
- arr = wb.Sheets(1).UsedRange
- wb.Close False
- For i = 2 To UBound(arr)
- If arr(i, 1) <> Empty Then
- m = m + 1
- brr(m, 1) = arr(i, 1)
- brr(m, 2) = arr(i, 2)
- End If
- Next
- End If
- Next f
- With sh
- .Columns(1).NumberFormatLocal = "@"
- .[a2].Resize(m, 2) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|