Open worksheet by date

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

I have a workbook which contains twelve worksheets - January,
February............., December.
I would like to have the active worksheet upon opening correspond to the
current month.
E.g. if the workbook is opened in March then the "March" worksheet displays.
How can I do this?

Sandy
 
Sandy,

Copy the code below and paste it into the Thisworkbook object's codemodule.

HTH,
Bernie
MS Excel MVP

Private Sub Workbook_Open()
On Error Resume Next
Worksheets(Format(Date, "mmmm")).Activate
End Sub
 
Perfect Bernie
Thank you very much.
Sandy

Bernie Deitrick said:
Sandy,

Copy the code below and paste it into the Thisworkbook object's
codemodule.

HTH,
Bernie
MS Excel MVP

Private Sub Workbook_Open()
On Error Resume Next
Worksheets(Format(Date, "mmmm")).Activate
End Sub
 
Back
Top