Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing through end of row
I'm trying to sum using vb from cell e3 to the bottom of the row which
will be a variable number of rows. For some reason, it doesn't like the last line in my code. I think I may have done something wrong at the end of the last line. Dim Rng As Range Set Rng = Range ("e3").End(xlDown) rng.Offset (1,0).Formula="=SUM(E"&rng.row&")" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing through end of row
Dim Rng as range
set rng = activesheet.range("E3").end(xldown) rng.offset(1,0).formular1c1 = "=sum(r1C:r[-1]c)" Sometimes using the .formulaR1C1 reference style makes coding a lot easier. And the user will still see the formula using the settings that they like. R1C is Row 1 of the same column R[-1]C is the row above the cell getting the formula, but the same column On 07/27/2010 14:43, tbmarlie wrote: I'm trying to sum using vb from cell e3 to the bottom of the row which will be a variable number of rows. For some reason, it doesn't like the last line in my code. I think I may have done something wrong at the end of the last line. Dim Rng As Range Set Rng = Range ("e3").End(xlDown) rng.Offset (1,0).Formula="=SUM(E"&rng.row&")" -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
summing through end of row
And if you wanted from Row 3, then the .formular1c1 would be:
rng.offset(1,0).formular1c1 = "=sum(r3c:r[-1]c)" (I didn't notice that portion of your question...) On 07/27/2010 14:43, tbmarlie wrote: I'm trying to sum using vb from cell e3 to the bottom of the row which will be a variable number of rows. For some reason, it doesn't like the last line in my code. I think I may have done something wrong at the end of the last line. Dim Rng As Range Set Rng = Range ("e3").End(xlDown) rng.Offset (1,0).Formula="=SUM(E"&rng.row&")" -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Summing it up | Excel Worksheet Functions | |||
PivotTable and summing/not summing | Excel Discussion (Misc queries) | |||
Summing all BUT one... | Excel Worksheet Functions | |||
Please Help with Summing | Excel Discussion (Misc queries) | |||
Summing | Excel Programming |