Activate Method

Microsoft Excel Visual Basic

ShowActivate method as it applies to the Chart and ChartObject object.

Makes the current chart the active chart.

expression.Activate

expression    Required. An expression that returns one of the above objects.

ShowActivate method as it applies to the Worksheet object.

Makes the current sheet the active sheet. Equivalent to clicking the sheet's tab.

expression.Activate

expression    Required. An expression that returns one of the above objects.

ShowActivate method as it applies to the OLEObject object.

Activates the object.

expression.Activate

expression    Required. An expression that returns one of the above objects.

ShowActivate method as it applies to the Pane object.

Activates the pane. If the pane isn't in the active window, the window that the pane belongs to will also be activated. You cannot activate a frozen pane.

expression.Activate

expression    Required. An expression that returns one of the above objects.

ShowActivate method as it applies to the Range object.

Activates a single cell, which must be inside the current selection. To select a range of cells, use the Select method.

expression.Activate

expression    Required. An expression that returns one of the above objects.

ShowActivate method as it applies to the Window object.

Brings the window to the front of the z-order. This won't run any Auto_Activate or Auto_Deactivate macros that might be attached to the workbook (use the RunAutoMacros method to run those macros).

expression.Activate

expression    Required. An expression that returns one of the above objects.

ShowActivate method as it applies to the Workbook object.

Activates the first window associated with the workbook. This won't run any Auto_Activate or Auto_Deactivate macros that might be attached to the workbook (use the RunAutoMacros method to run those macros).

expression.Activate

expression    Required. An expression that returns one of the above objects.

Example

ShowAs it applies to the Worksheet object.

This example activates Sheet1.

Worksheets("Sheet1").Activate
				

ShowAs it applies to the Range object.

This example selects cells A1:C3 on Sheet1 and then makes cell B2 the active cell.

Worksheets("Sheet1").Activate
Range("A1:C3").Select
Range("B2").Activate
				

ShowAs it applies to the Workbook object.

This example activates Book4.xls. If Book4.xls has multiple windows, the example activates the first window, Book4.xls:1.

Workbooks("BOOK4.XLS").Activate