|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 汇总()
Dim arr()
ReDim arr(1 To Sheets.Count, 1 To 3)
For Each sh In Sheets
If sh.Name <> "汇总表" Then
r = sh.Cells(Rows.Count, 6).End(xlUp).Row
zd = Application.Max(sh.Range("f3:f" & r))
n = n + 1
arr(n, 1) = n
arr(n, 2) = sh.Name
arr(n, 3) = zd
End If
Next sh
With Sheets("汇总表")
.[a1].CurrentRegion.Offset(2).Borders.LineStyle = 0
.[a1].CurrentRegion.Offset(2) = Empty
.[a3].Resize(n, 3) = arr
.[a3].Resize(n, 4).Borders.LineStyle = 1
End With
MsgBox "ok!"
End Sub
|
|