Results 1 to 4 of 4

FormulaR1C1

This is a discussion on FormulaR1C1 within the Excel Questions forums, part of the Question Forums category; hey i am just kind of getting back into VBA and i have a sheet into which i need to ...

  1. #1
    Board Regular
    Join Date
    Feb 2003
    Posts
    105

    Default FormulaR1C1

    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.

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959

    Default Re: FormulaR1C1

    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.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959

    Default Re: FormulaR1C1

    And from the help file:

    Quote Originally Posted by Microsoft
    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)"
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  4. #4
    Board Regular
    Join Date
    Feb 2003
    Posts
    105

    Default Re: FormulaR1C1

    thank you!

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com