我得到了#34;类型不匹配"键入此VBA代码时出错。我希望VBA每6行汇总所有单元格的值。请帮忙!
Sub sums()
Dim m As Integer
Dim n As Integer
Dim sum12 As Long
For m = 7 To 500 ' Columns
sum12 = 0
For n = 24 To 500 Step 6 ' Rows
sum12 = sum12 + Cells(n, m)
Next n
Cells(11, m) = totalsum
Next m
End Sub