activate a worksheet

Activate a worksheet using VBA

Calling the Activate method of a Worksheet object makes that sheet the active sheet, meaning it visually is on top and all macro actions that use ranges without explicitly specifying which sheet will use the ActiveSheet.


Dim wb As Workbook: Set wb =
Dim ws As Worksheet: Set ws = wb.Sheets("Sheet2")
ws.Activate

Activate and Select

You can Select multiple sheets at the same time ...


Dim wb As Workbook: Set wb =
wb.Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select

... but you can only Activate one

With Activate, if you presently have more than one sheet selected, the ActiveSheet will change, but all selected sheets will remain selected.

With Select, the selected sheet becomes the ActiveSheet. If more sheets are selected (as above), the first in the array is made active sheet.