
For example: Following are the two macro statements both will refer the active sheet.īoth the above statements print some value at Range A1 of Activesheet. If you ignore the ActiveSheet object while refering any other object like range or chart, VBA will treat the ActiveSheet as the current sheet by default.

ActiveSheet VBA object is very usefull while automating tasks and working on currently active sheet in the active workbook window. We can refer the currently activated worksheet using Excel VBA ActiveSheet object. In this example we are activating first Worksheet in the active workbook.
#Do i have to activate visual basic on excel for mac code
Please see the below VBA code or macro procedure to activate Worksheet. VBA Activate Worksheet Method– with Number: Example 2 In this example we are activating a Worksheet named “Project1”. Please see the below VBA codes to activate Worksheet. VBA Activate Worksheet – with Name: Example 1 Where Activate is the method of Workbook object is used to makes current sheet as active sheet.

Worksheets(“Your Worksheet Name”).Activate Always best practice is to use sheet name. You can use either a Worksheet name or Worksheet number. Here is the example syntax to activate Worksheet using VBA. When we are working with multiple sheets in a workbook, if we want to move or go to another sheet in the same workbook or another workbook we use activate worksheet method. We use Activate worksheet method to activate current sheet as active sheet. When we need to use Activate Worksheet method in VBA? VBA Activate Worksheet Method- Instructions.

