Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open a workbook to a specific worksheet (Excel 2003)

    A client has created a workbook with several worksheet tabs. One of these tabs is a table of contents with hyperlinks to the other tabs using named range labels.

    What she wants to have happen is that when the workbook is opened up the table of contents (presumably tab1) is always displayed first.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Open a workbook to a specific worksheet (Excel 2003)

    You can create VBA code that will run when the workbook is opened and activate the table of contents sheet:
    - Open the workbook.
    - Press Alt+F11 to activate the Visual Basic Editor.
    - Double-click the ThisWorkbook node belonging to the workbook in the Project Explorer on the left hand side.
    - Type or paste the following code into the code window that appears:

    Private Sub Workbook_Open()
    Worksheets(1).Select
    End Sub

    If the TOC sheet is not the first one, you can either specify the correct number, or supply its name instead of its number:

    Worksheets("Contents").Select

    where Contents must be replaced with the appropriate name.

    Users must enable macros when opening the workbook, otherwise the code will not run.

  3. #3
    Lounger
    Join Date
    Jul 2001
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open a workbook to a specific worksheet (Excel 2003)

    Thanks again Hans - I will try this code snippet with my client.

Posting Permissions

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