Formula property

Zain

New Member
Joined
Sep 4, 2007
Messages
43
Hi

I need to add up the cells in a certain column but I have the row references stored in variables (of type Integer). So if upper and lower are the row references then the code I tried is:

ActiveCell.Formula = "=SUM(Cashflows!C & Upper:C & Lower)" .

This didn't work.

Help please?
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Dylan

Board Regular
Joined
Jul 27, 2007
Messages
150
It should be this way.
ActiveCell.Formula = "=SUM(Cashflows!C" & Upper & ":C" & Lower & ")"
 

Zain

New Member
Joined
Sep 4, 2007
Messages
43
Thanks a lot!! I'm sure this is some sort of record for speediness.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,314
Members
414,053
Latest member
Dual Showman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top