|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Option Explicit
- Sub 统计()
- Dim sh
-
- For Each sh In Worksheets
- If sh.Name <> "新建汇总" Then
- sh.Activate
- Call ttt1
-
- End If
- Next
-
- End Sub
- Sub ttt1()
- Dim nrow&, ncolumn&, arr1(), i&, j&, brr()
-
- With ActiveSheet
-
- nrow = .Range("AA65536").End(xlUp).Row - 7
- ncolumn = .Range("XFD8").End(1).Column - 5
-
- arr1 = .Range("E8").Resize(nrow, ncolumn).Value
-
- End With
-
- ReDim brr(1 To ncolumn)
-
-
- For j = 1 To ncolumn
- For i = 1 To nrow
- If arr1(i, j) <> "" Then
-
- brr(j) = brr(j) + arr1(i, j)
- End If
- Next i
-
- Next j
-
- ActiveSheet.Range("E8").Offset(nrow + 2, 0).Resize(1, ncolumn) = brr()
-
-
-
- End Sub
复制代码 |
|