|
参与一下。。。- Sub 多表合并() '//2024.12.24
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Dim arr, brr(1 To 10000, 1 To 100)
- For Each sht In Sheets
- If InStr(sht.Name, "厂") Then
- With sht
- r = .Cells(Rows.Count, 1).End(3).Row
- c = .UsedRange.Columns.Count
- arr = .[a1].Resize(r, c)
- bt = .Columns(1).Find("序号").Row
- End With
- For i = bt + 1 To UBound(arr)
- If Val(arr(i, 1)) Then
- m = m + 1
- brr(m, 1) = m
- For j = 2 To UBound(arr, 2)
- brr(m, j) = arr(i, j)
- Next j
- End If
- Next i
- End If
- Next
- With Sheets("汇总表")
- .UsedRange.Offset(3).ClearContents
- .[a4].Resize(m, c) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|