|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
呵呵 不用了看到你是新同学 第一次发帖
我帮你写一个
- Sub 汇总()
- Dim arr, brr(1 To 10000, 1 To 20)
- Dim ws As Worksheet
- For Each ws In Worksheets
- If ws.Name <> "汇总" Then
- With ws
- r = .Cells(.Rows.Count, 2).End(xlUp).Row
- c = .Cells(1, .Columns.Count).End(xlToLeft).Column
- arr = .Range("a1").Resize(r, c)
- For i = 2 To r
- n = n + 1
- For j = 1 To c
- brr(n, j) = arr(i, j)
- Next
- Next
- End With
- End If
- Next
- With Worksheets("汇总")
- .[a2].Resize(n, UBound(brr, 2)) = brr
- End With
- MsgBox "OK !"
- End Sub
复制代码 |
|