|
- Dim n%
- Sub Macro1()
- n = n + 1
- If n > 1 Then Exit Sub
- Dim mypath$$, wj$$, arr, brr, i&
- mypath = ThisWorkbook.Path & ""
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- wj = Dir(mypath & "*.xls*")
- Do While wj <> ""
- If wj <> ThisWorkbook.Name Then
- With Workbooks.Open(mypath & wj)
- arr = Range("a1").CurrentRegion
- ReDim brr(1 To UBound(arr), 1 To 1)
- For i = 1 To UBound(arr)
- brr(i, 1) = i
- Next
- Cells(1, UBound(arr, 2) + 1).Resize(i - 1) = brr
- .Close 1
- End With
- End If
- wj = Dir
- Loop
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
查看全部评分
|