+ Reply to Thread
Results 1 to 3 of 3

Open workbook to specific worksheet

  1. #1
    Dave
    Guest

    Open workbook to specific worksheet

    Is there a way to have a workbook open to a certain worksheet regardless of
    which worksheet was active when the file was saved and clsoed?

    Example:
    Worksheets in workbook - data, budget, analysis, comments

    Saved and closed with data worksheet active

    On open have budget worksheet active

    Thanks


  2. #2
    Paul B
    Guest

    Re: Open workbook to specific worksheet

    Dave, you could put some code in the workbook open event like this

    Private Sub Workbook_Open()
    Sheets("budget").Select
    End Sub

    To put in this macro, from your workbook right-click the workbook's icon and
    pick View Code. This icon is to the left of the "File" menu this will open
    the VBA editor, in the left hand window double click on thisworkbook, under
    your workbook name, and paste the code in the window that opens on the right
    hand side, press Alt and Q to close this window and go back to your
    workbook, now this will run every time you open the workbook. If you are
    using excel 2000 or newer you may have to change the macro security
    settings to get the macro to run. To change the security settings go to
    tools, macro, security, security level and set it to medium




    --
    Paul B
    Always backup your data before trying something new
    Please post any response to the newsgroups so others can benefit from it
    Feedback on answers is always appreciated!
    Using Excel 2002 & 2003




    "Dave" <[email protected]> wrote in message
    news:[email protected]...
    > Is there a way to have a workbook open to a certain worksheet regardless
    > of
    > which worksheet was active when the file was saved and clsoed?
    >
    > Example:
    > Worksheets in workbook - data, budget, analysis, comments
    >
    > Saved and closed with data worksheet active
    >
    > On open have budget worksheet active
    >
    > Thanks
    >




  3. #3
    Gord Dibben
    Guest

    Re: Open workbook to specific worksheet

    Dave

    To open at a specific sheet you would need to save the workbook at that sheet
    or activate that sheet upon opening the workbook.

    Private Sub Workbook_Open
    Sheets("MySheet").Activate
    'if want a specific cell add
    Range("G23").Select
    End Sub

    OR select when you save the workbook.

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Sheets("MySheet").Activate
    'if want a specific cell add
    Range("G23").Select
    End Sub

    Copy/paste either of the above to the ThisWorkbook module.

    With workbook open hit ALT + F11 to get to Visual Basic Editor. CRTL + r to
    open Project Explorer.

    Find your workbook/project and expand the MS Excel Objects.

    Double-click on ThisWorkbook to open.

    Paste the code in there.

    ALT + Q to go back to Excel window.

    Make sure the workbook Security is set to "Medium" under
    Tools>Options>Security>Macro Security.

    Save.


    Gord Dibben Excel MVP

    On Mon, 2 May 2005 11:39:01 -0700, "Dave" <[email protected]>
    wrote:

    >Is there a way to have a workbook open to a certain worksheet regardless of
    >which worksheet was active when the file was saved and clsoed?
    >
    >Example:
    >Worksheets in workbook - data, budget, analysis, comments
    >
    >Saved and closed with data worksheet active
    >
    >On open have budget worksheet active
    >
    >Thanks



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1