View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips[_4_] Bob Phillips[_4_] is offline
external usenet poster
 
Posts: 834
Default To sum the values of the cell

Try

x = Application.Sum(Range(Cells(i1, "A"), Cells(i2, "A")))

--

HTH

Bob

"Subodh" wrote in message
...
I want to sum up the values of cells using VBA.
Lets say from Range A10 to A100 and make it as a vary.
Also, the rows 10 and 100 are supplied by the user.
However, the follwing does not work
Dim xsum as long
i1=10
i2=100
x = sum(cells("A(i1):A(i2)")
does not works.
Can anyone help?
Thanks in advance.