ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open a sheet based on day of the week! (https://www.excelbanter.com/excel-programming/436392-open-sheet-based-day-week.html)

Robert Crandal

Open a sheet based on day of the week!
 
My workbook has 7 tabs named as "Monday" through "Friday"
respectively.

Whenever a user opens my workbook, I would like Excel to
immediately display the sheet that corresponds to the day of the
week. So, if it's Wednesday, I would like Excel to immediately
display the sheet named "Wednesday" upon load/open.

How would I do this??? I prefer a solution that does not use
Visual Basic, but if none exist, then i'll accept a Visual Basic
solution.

thank you


Rick Rothstein

Open a sheet based on day of the week!
 
You will need VB code to do this. Press Alt+F11 to go into the VB editor and
double click the ThisWorkbook item in the Project Window to bring up its
code window, then copy/paste this code into that code window...

Private Sub Workbook_Open()
Worksheets(Format(Date, "dddd")).Activate
End Sub

Save the workbook. Next time you open it, you will be taken to the
appropriate worksheet. By the way, I'm confused by your description where
you said that your "workbook has 7 tabs named as 'Monday' through
'Friday'"... Monday through Friday would only take up 5 worksheets, not 7.

--
Rick (MVP - Excel)


"Robert Crandal" wrote in message
...
My workbook has 7 tabs named as "Monday" through "Friday"
respectively.

Whenever a user opens my workbook, I would like Excel to
immediately display the sheet that corresponds to the day of the
week. So, if it's Wednesday, I would like Excel to immediately
display the sheet named "Wednesday" upon load/open.

How would I do this??? I prefer a solution that does not use
Visual Basic, but if none exist, then i'll accept a Visual Basic
solution.

thank you




All times are GMT +1. The time now is 09:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com