NamedRange.FormulaArray Property

Definition

Gets or sets the array formula of the NamedRange control.

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

Property Value

The array formula of the NamedRange control.

Examples

The following code example creates a NamedRange and then uses the FormulaArray property to set the value of the NamedRange to equal the sum of the array of cells A1 through A3.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange formualArrayRange;
private void SetFormulaArray()
{
    formualArrayRange = this.Controls.AddNamedRange(
        this.Range["B1"], "formualArrayRange");
    this.Range["A1", "A3"].Value2 = 3333;
    this.formualArrayRange.FormulaArray = "=Sum(R1C1:R3C1)";
}
Private formualArrayRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub SetFormulaArray()
    formualArrayRange = Me.Controls.AddNamedRange( _
        Me.Range("B1"), "formualArrayRange")
    Me.Range("A1", "A3").Value2 = 3333
    Me.formualArrayRange.FormulaArray = "=Sum(R1C1:R3C1)"
End Sub

Remarks

This property returns (or can be set to) a single formula or an array.

If the NamedRange control does not contain an array formula, this property returns null.

If you use this property to enter an array formula, the formula must use the R1C1 reference style, not the A1 reference style.

Applies to