|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.8.2
- Application.ScreenUpdating = False
- Set sh = ThisWorkbook.Sheets("汇总表")
- ReDim brr(1 To 1000, 1 To 100)
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- n = n + 1
- m = 1
- brr(1, n) = sht.Name
- With sht
- r = .Cells(Rows.Count, 4).End(3).Row
- arr = .[d1].Resize(r, 1)
- For i = 2 To UBound(arr)
- If arr(i, 1) <> Empty Then
- m = m + 1
- brr(m, n) = arr(i, 1)
- End If
- Next
- End With
- Max = IIf(Max < m, m, Max)
- End If
- Next
- With sh
- .Cells.Clear
- .[a1].Resize(Max, n) = brr
- ' .[a1].Resize(Max, n).EntireColumn.AutoFit
- End With
- Application.ScreenUpdating = False
- MsgBox "OK!"
- End Sub
复制代码
|
|