Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 99
Default To sum the values of the cell

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.

  #2   Report Post  
Posted to microsoft.public.excel.misc
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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 99
Default To sum the values of the cell

On Mar 16, 1:32*pm, "Bob Phillips" wrote:
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.- Hide quoted text -


- Show quoted text -


Thanks Bob.
It really worked.
  #4   Report Post  
Posted to microsoft.public.excel.misc
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.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLookup multiple values - sum returned values into single cell se7098 Excel Worksheet Functions 12 April 2nd 23 07:32 PM
Copy values from a cell based on values of another cell Spence10169 Excel Discussion (Misc queries) 4 January 13th 09 10:01 AM
How to assign values to a cell based on values in another cell? Joao Lopes Excel Worksheet Functions 1 December 5th 07 09:02 PM
Replacing Linked Cell Values w/ Current Values TomCat Excel Worksheet Functions 6 April 10th 06 12:20 PM


All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"