+ Reply to Thread
Results 1 to 3 of 3

Run a sheet's activate code when entering it's workbook

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Run a sheet's activate code when entering it's workbook

    I have sheet activate code for every worksheet in a workbook.

    I have auto_open code that selects the sheet named data.

    The proplem is if the sheet named data was active when I exited the workbook, the sheet active code for data will not execute when opening the workbook. I have click another sheet then click back into the sheet named data to get the code to execute.

    Any ideas would be greatly appreciated. mikeburg

  2. #2
    Gary Keramidas
    Guest

    Re: Run a sheet's activate code when entering it's workbook

    did you try the code on the thisworkbook code page
    Private Sub Workbook_Open()
    --


    Gary


    "mikeburg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have sheet activate code for every worksheet in a workbook.
    >
    > I have auto_open code that selects the sheet named data.
    >
    > The proplem is if the sheet named data was active when I exited the
    > workbook, the sheet active code for data will not execute when opening
    > the workbook. I have click another sheet then click back into the sheet
    > named data to get the code to execute.
    >
    > Any ideas would be greatly appreciated. mikeburg
    >
    >
    > --
    > mikeburg
    > ------------------------------------------------------------------------
    > mikeburg's Profile:
    > http://www.excelforum.com/member.php...o&userid=24581
    > View this thread: http://www.excelforum.com/showthread...hreadid=490371
    >




  3. #3
    Dave Peterson
    Guest

    Re: Run a sheet's activate code when entering it's workbook

    Maybe just select a different sheet, then select the sheet you want in your
    workbook_open event.

    Or just call the worksheet_activate event from the workbook_open event:

    Option Explicit
    Private Sub Workbook_Open()
    Call Sheet2.Worksheet_Activate
    End Sub

    Use the codename (I used sheet2).

    And remove Private from the
    Private Sub Worksheet_Activate()
    line.

    mikeburg wrote:
    >
    > I have sheet activate code for every worksheet in a workbook.
    >
    > I have auto_open code that selects the sheet named data.
    >
    > The proplem is if the sheet named data was active when I exited the
    > workbook, the sheet active code for data will not execute when opening
    > the workbook. I have click another sheet then click back into the sheet
    > named data to get the code to execute.
    >
    > Any ideas would be greatly appreciated. mikeburg
    >
    > --
    > mikeburg
    > ------------------------------------------------------------------------
    > mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
    > View this thread: http://www.excelforum.com/showthread...hreadid=490371


    --

    Dave Peterson

+ 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