How do you sum a range in a sheet using vba.
I tried many different things but I can't figure it out. Thank you.
Sheet3.Sum...
How do you sum a range in a sheet using vba.
I tried many different things but I can't figure it out. Thank you.
Sheet3.Sum...
One method would be
Dim rng as Range
Dim lAnswer as Long
Set rng = sheets(1).Range("A1:A5")
lAnswer = application.WorksheetFunction.Sum(rng)
This works because application.WorksheetFunction creates a reference to all functions available within an excel sheet.