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
本文转自斯克迪亚博客园博客,原文链接:http://www.cnblogs.com/sgsoft/archive/2004/09/02/38882.html,如需转载请自行联系原作者