Sum the range : Range Value « Excel « VBA / Excel / Access / Word






Sum the range

 

Sub addAmtAbs()
    Set myRange = Range(ActiveCell, ActiveCell.End(xlUp))   '   Substitute your range here
    Dim myCount As Integer
    myCount = Application.Count(myRange)
    ActiveCell.Formula = "=SUM(B1:B" & myCount & ")"  '   Substitute your cell address here
End Sub

 








Related examples in the same category

1.Reset value in a range to zero
2.Return cell value in a range as an array
3.Change cell A1 and move to cell A2 and change it
4.Clear NonDate Cells
5.Transferring one-dimensional arrays with build-in function