|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
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
|
|