FormulaR1C1

bdee1

Board Regular
Joined
Feb 17, 2003
Messages
105
hey i am just kind of getting back into VBA and i have a sheet into which i need to insert some formulas.

I know this is done with activecell.formulaR1C1 = Formula

however i am getting some weird things happening when i try to use FormulaR1C1 - can someone please point me to some documentation on how FormulaR1C1 works?

i looked in the help files and cant find anything.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
R1C1 is the notation that the macro recorder uses...altough its sometimes useful, I rarely use it.

Compare this:

ActiveCell.Formula = "=A1"

and

ActiveCell.FormulaR1C1 = "=R1C1"

they both do the same thing.
 
Upvote 0
And from the help file:

Microsoft said:
FormulaR1C1 Property

Returns or sets the formula for the object, using R1C1-style notation in the language of the macro. Read/write Variant for Range objects, read/write String for Series objects.

Remarks
If the cell contains a constant, this property returns the constant. If the cell is empty, the property returns an empty string. If the cell contains a formula, the property returns the formula as a string, in the same format in which it would be displayed in the formula bar (including the equal sign).

If you set the value or formula of a cell to a date, Microsoft Excel checks to see whether that cell is already formatted with one of the date or time number formats. If not, the number format is changed to the default short date number format.

If the range is a one- or two-dimensional range, you can set the formula to a Visual Basic array of the same dimensions. Similarly, you can put the formula into a Visual Basic array.

Setting the formula of a multiple-cell range fills all cells in the range with the formula.

Example
This example sets the formula for cell B1 on Sheet1.

Worksheets("Sheet1").Range("B1").FormulaR1C1 = "=SQRT(R1C1)"
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

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