计算列和的宏
Dim intI As Long
Dim maxLong As Long
Dim cell As String
Dim sum As Long
sum = 0
maxLong = 65532
For intI = 2 To maxLong
cell = "h" + LTrim(Str(intI))
If IsNumeric(Range(cell)) Then
sum = sum + Range(cell)
End If
If Trim(Range(cell)) = "" Then
Range("A2") = sum
Exit For
End If
Next
End Sub
Dim maxLong As Long
Dim cell As String
Dim sum As Long
sum = 0
maxLong = 65532
For intI = 2 To maxLong
cell = "h" + LTrim(Str(intI))
If IsNumeric(Range(cell)) Then
sum = sum + Range(cell)
End If
If Trim(Range(cell)) = "" Then
Range("A2") = sum
Exit For
End If
Next
End Sub