+ Reply to Thread
Results 1 to 6 of 6

Open Worksheet

  1. #1
    Registered User
    Join Date
    07-19-2006
    Posts
    7

    Open Worksheet

    How do you get a macro to run whenever a worksheet is opened?

  2. #2
    NickHK
    Guest

    Re: Open Worksheet

    Darren,
    Open the ThisWorkbook module and enter you code in the:
    Private Sub Workbook_Open()

    End Sub

    NickHK

    "DarrenG" <[email protected]> wrote in
    message news:[email protected]...
    >
    > How do you get a macro to run whenever a worksheet is opened?
    >
    >
    > --
    > DarrenG
    > ------------------------------------------------------------------------
    > DarrenG's Profile:

    http://www.excelforum.com/member.php...o&userid=36529
    > View this thread: http://www.excelforum.com/showthread...hreadid=565060
    >




  3. #3
    Norman Jones
    Guest

    Re: Open Worksheet

    Hi Darren,

    Try:

    '=============>>
    Private Sub Workbook_Open()
    Call MyMacro
    End Sub
    '<<=============

    This is workbook event code and should be pasted into the workbook's
    ThisWorkbook module *not* a standard module or a sheet module:

    Right-click the Excel icon on the worksheet
    (or the icon to the left of the File menu if your workbook is maximised)
    Select 'View Code' from the menu and paste the code.
    Alt-F11 to return to Excel.


    ---
    Regards,
    Norman



    "DarrenG" <[email protected]> wrote in
    message news:[email protected]...
    >
    > How do you get a macro to run whenever a worksheet is opened?
    >
    >
    > --
    > DarrenG
    > ------------------------------------------------------------------------
    > DarrenG's Profile:
    > http://www.excelforum.com/member.php...o&userid=36529
    > View this thread: http://www.excelforum.com/showthread...hreadid=565060
    >




  4. #4
    Bob Phillips
    Guest

    Re: Open Worksheet

    Private Sub Worksheet_Activate()

    'your code here


    End Sub

    'This is worksheet event code, which means that it needs to be
    'placed in the appropriate worksheet code module, not a standard
    'code module. To do this, right-click on the sheet tab, select
    'the View Code option from the menu, and paste the code in.



    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "DarrenG" <[email protected]> wrote in
    message news:[email protected]...
    >
    > How do you get a macro to run whenever a worksheet is opened?
    >
    >
    > --
    > DarrenG
    > ------------------------------------------------------------------------
    > DarrenG's Profile:

    http://www.excelforum.com/member.php...o&userid=36529
    > View this thread: http://www.excelforum.com/showthread...hreadid=565060
    >




  5. #5
    Norman Jones
    Guest

    Re: Open Worksheet

    Hi Darren,

    I misread your request.

    If you mean worksheet, as stated, and not workbook, use the code suggested
    by Bob.

    ---
    Regards,
    Norman



  6. #6
    Registered User
    Join Date
    07-19-2006
    Posts
    7
    Perfect, 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