VBA FormulaR1C1 problem

Lochnagar

New Member
Joined
Jan 28, 2008
Messages
43
Hi,

I'm trying to input a formula into a cell using the FormulaR1C1 method, but I've hit a small problem. Basically the formula I'm inputing refers to the adjacent cells

e.g. Activecell.FormulaR1C1 = "=RC[-1]+RC[-2]..."

However what I'm wondering is is it possible to input a formula that refers to a fixed cell (in the example below cell $B$3) in addition to adjoining cells

e.g. Activecell.FormulaR1C1 = "=RC[-1]+RC[-2]+$B$3",


Any help or suggestions will be greatly appreciated.

Thanks in advance,

Lochnagar
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Lochnagar

You can't mix R1C1 and A1 notation like that.

Try this.
Code:
ActiveCell.FormulaR1C1 = "=RC[-1]+RC[-2]+R3C2"
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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
Back
Top