|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 汇总()
Dim sh As Worksheet
Dim ar As Variant
Dim arr()
ReDim arr(1 To Sheets.Count - 1, 1 To 35)
For Each sh In Sheets
If sh.Name <> "汇总表" Then
ar = sh.Range("a1:l64")
n = n + 1
arr(n, 1) = n
arr(n, 2) = ar(3, 2)
arr(n, 3) = ar(5, 2)
arr(n, 4) = ar(7, 2)
arr(n, 5) = ar(9, 2)
arr(n, 6) = ar(7, 5)
arr(n, 7) = ar(9, 5)
arr(n, 8) = ar(9, 9)
'''以下自己一样画葫芦吧
End If
Next sh
With Sheets("汇总表")
.UsedRange.Offset(3) = Empty
.[a4].Resize(n, UBound(arr, 2)) = arr
End With
MsgBox "ok!"
End Sub |
|