|
参与一下。。。- Sub ykcbf() '//2024.1.24
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Dim arr, brr
- Dim tm: tm = Timer
- Set fso = CreateObject("Scripting.FileSystemObject")
- On Error Resume Next
- p = ThisWorkbook.Path & ""
- f = p & "A.xlsx"
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets(1)
- arr = .UsedRange
- wb.Close False
- End With
- f = p & "B.xlsx"
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets(1)
- brr = .UsedRange
- wb.Close False
- End With
- f = p & "C.xlsx"
- Set wb = Workbooks.Open(f, 0)
- With wb.Sheets(1)
- .Cells.celar
- .[a1].Resize(UBound(arr), 1) = arr
- r = .Cells(Rows.Count, 1).End(3).Row
- .Cells(r + 1, 1).Resize(UBound(brr), 1) = brr
- End With
- wb.Close 1
- Application.ScreenUpdating = True
- MsgBox "共用时:" & Format(Timer - tm) & "秒!"
- End Sub
复制代码
|
|