Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: "Auto_open" macro to select last worksheet used?

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Dublin, Ireland
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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?

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Dublin, Ireland
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You could just save it on the sheet you want it to open on

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Location
    Dublin, Ireland
    Posts
    51
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •