View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default To sum the values of the cell

Try

Dim xsum As Variant
i1 = 10
i2 = 100
x = Application.Sum(Range(Cells(i1, "A"), Cells(i2, "A")))

--
Jacob


"Subodh" wrote:

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.

.