"Auto_open" macro to select last worksheet used?

Shane

Board Regular
Joined
Apr 8, 2002
Messages
51
Hi! I have an auto open macro that opens the same worksheet every time:

Sub auto_open()
Sheets("Sheet1").Select
Beep
End Sub

There are, however, multiple worksheets in my workbook and I want the macro to open the worksheet that was open when the file wasa last closed, i.e. If "Sheet3" was the last worksheet in use when last session was terminated, then the next user to open the file should find "Sheet3" open when the new session is launched.

Any suggestions out there?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I can tell you that excel will remember the last sheet opened upon saving your workbook everytime you close it. If you remove the macro, excel will open to the last sheet before it was closed.
I hope this is what your asking?
Todd
 
Upvote 0
Todd, I explained poorly. My question isn't quite that straight forward. What I should have said:

Let's say I have a workbook with 5 worksheets. Sheets 1 and 2 are reference tables. Sheets 3, 4 and 5 are in regular use. Say I am working between sheets 3, 4 and 5, but sheet 1 is the last sheet I use before closing the file.

When the file is reopened, it will default to sheet 1. What I want to happen here is that instead of opening sheet 1, Excel remembers the last worksheet used (excluding sheets 1 and 2) and opens the last used sheet 3, 4 or 5.

Hope this is clearer.
 
Upvote 0
There are multiple users of this file. I need to know which of the sheets 3, 4 or was used last by the previous user.
 
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,229
Members
448,879
Latest member
VanGirl

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