在VBA中键入Mismatch for excel让我发疯

时间:2016-06-13 20:34:13

标签: excel-vba vba excel

我得到了#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

0 个答案:

没有答案