Thread: summing in vba
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default summing in vba

If you know the column that you are putting the data in, for instance, column
F, then you could use:

Sub addItup()
Dim mySum As Double
mySum = WorksheetFunction.Sum(Range("F2":F" _
& Range("F65536").End(xlUp).Row)
MsgBox mySum
End Sub

That would give you the sum of the values in column F as a dynamic range,
assuming a header row.


"Joseph Atie" wrote:

im using excel to build a labour list from an ms project data file

the job im trying to do is sum column after i populate it using a pair of
for loops

so the only thing method i have of identifying the files i need to sum is
the counters of the loops.

I can do it via so more loops and an extra variable.

What i want to know is:

is there a simpler way to do it? perhaps an expression that i could use
something along the lines of:

cell.value = "=sum(counter:counter1)"

thanks in advance for any help