Share via


XmlMappedRange.FormulaR1C1 Property

Definition

Gets or sets the formula for the XmlMappedRange control, using R1C1-style notation.

public:
 property System::Object ^ FormulaR1C1 { System::Object ^ get(); void set(System::Object ^ value); };
public object FormulaR1C1 { get; set; }
member this.FormulaR1C1 : obj with get, set
Public Property FormulaR1C1 As Object

Property Value

The formula for the XmlMappedRange control, using R1C1-style notation.

Examples

The following code example uses the FormulaR1C1 property to set the value of an XmlMappedRange to equal the square root of cell A1, as specified using R1C1 notation. This code example assumes that the current worksheet contains an XmlMappedRange named CustomerAddress1Cell with a corresponding schema element of type int.

private void SetFormulaR1C1()
{
    this.Range["A1"].Value2 = 1185921;
    this.CustomerAddress1Cell.FormulaR1C1 = "=SQRT(R1C1)";
}
Private Sub SetFormulaR1C1()
    Me.Range("A1").Value2 = 1185921
    Me.CustomerAddress1Cell.FormulaR1C1 = "=SQRT(R1C1)"
End Sub

Remarks

If the XmlMappedRange control contains a constant, this property returns the constant.

If the XmlMappedRange control is empty, the property returns an empty string.

If the XmlMappedRange control 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 an XmlMappedRange control to a date, Microsoft Office 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.

Applies to