Export (0) Print
Expand All
Expand Minimize

NamedRange.Select Method

Selects the NamedRange control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Object Select()

Return Value

Type: System.Object

The following code example uses the Select method to select the cells in a NamedRange control that includes the range of cells A1 through E5.

This example is for a document-level customization.

private void SelectNamedRange()
{
    Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
        this.Controls.AddNamedRange(this.Range["A1", "E5"],
        "namedRange1");

    namedRange1.Select();
}

Show:
© 2014 Microsoft