Tab select when file is opened

Copper Contributor

I would like to has specific tab (worksheet) opened based on current date. 

 

Workbook is set up for 31 days, each tab represents a specific day of month.

 

I would like the proper tab opened based on current date.

2 Replies

@Mike_Burgett 

Press Alt+F11 to activate the Visual Basic Editor.

Double-click ThisWorkbook under Microsoft Excel Objects in the project explorer pane on the left hand side.

Are the tabs named 1, 2, 3 etc.?

If so, copy the following code into the ThisWorkbook module:

Private Sub Workbook_Open()
    Worksheets(CStr(Day(Date))).Select
End Sub

Switch back to Excel.

Save the workbook as a macro-enabled workbook (*.xlsm).

Make sure that you allow macros when you open it.

@Hans Vogelaar 

 

I got it to work thanks