WorksheetBase.Select Method (Object)

 

Selects the worksheet.

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

public void Select(
	object replace
)

Parameters

replace
Type: System.Object

true to remove the current selection and select the worksheet instead; false to extend the current selection to include any previously selected objects and the worksheet.

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example uses the Select method to select Sheet1, and then extends the selection to include Sheet2 and Sheet3.

This example is for a document-level customization.

private void SelectWorksheets()
{
    Globals.Sheet1.Select(true);
    Globals.Sheet2.Select(false);
    Globals.Sheet3.Select(false);
}
Return to top
Show: