VB code to sum up all the figures in a column

T

tanks1308

Hello all, need your help to solve my problem. You see, I have a sourc
file which consists of Names, figures. I am writing a VB code or set
macro to calculate the total sum of the figure column, my problem is
managed to sum up the figures but sometimes the source file migh
consists of many records, so how do I solve this problem by taking int
account that it will calculate all the figures in that column
Appreciate ur help
 
M

Myrna Larson

Let's say the numbers are in column D.

Total = Application.Sum(ActiveSheet.Columns(4))

or

Total = Application.Sum(Intersect(ActiveSheet.UsedRange,
ActiveSheet.Columns(4)))
 
Top