Excel 2010, shared workbook does not open to last tab worked in.

haydenmike

New Member
Joined
Nov 21, 2018
Messages
3
We have a schedule that about 7 people access. When a user opens the workbook it keeps defaulting to a tab that was the work schedule from several weeks earlier. I would like it to default to opening in the current weekly schedule. Or just open in the last used / saved tab?
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this, it will need to be entered in "ThisWorkbook" in the VBA editor.

Code:
Private Sub Workbook_Open()


weekstartmonth = WorksheetFunction.Text(Now, "Mmm")
weekstartday = Format(Now - Weekday(Now, vbUseSystem) + 1, "DD")
weekendmonth = WorksheetFunction.Text(Now - Weekday(Now, 2) + 8, "Mmm")
weekendday = Format(Now - Weekday(Now, vbUseSystem) + 7, "DD")
myyear = Year(Now)


shtstr = weekstartmonth & " " & weekstartday & " to " & weekendmonth & " " & weekendday & "," & myyear


Sheets(shtstr).Select


End Sub
 
Upvote 0
I will try this on Monday. Thank you



Try this, it will need to be entered in "ThisWorkbook" in the VBA editor.

Code:
Private Sub Workbook_Open()


weekstartmonth = WorksheetFunction.Text(Now, "Mmm")
weekstartday = Format(Now - Weekday(Now, vbUseSystem) + 1, "DD")
weekendmonth = WorksheetFunction.Text(Now - Weekday(Now, 2) + 8, "Mmm")
weekendday = Format(Now - Weekday(Now, vbUseSystem) + 7, "DD")
myyear = Year(Now)


shtstr = weekstartmonth & " " & weekstartday & " to " & weekendmonth & " " & weekendday & "," & myyear


Sheets(shtstr).Select


End Sub
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top