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

Thread: Macro that automatically runs when workbook is opened

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I know this is a question that has already been answered some where in the forum. because I have seen it, but can not locate it for the life of me.

    What I want to do is just have a macro run whenever a given workbook is opened. How does one go about doing that?

    Thanks in advance for the help
    Paul

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

    Default

    Hi

    Auto_Open() the worlds your oyster~


    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

  3. #3
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Place the call function to your macro in the Workbook_Open event:

    Private Sub Workbook_Open()
    Call YourMacroName
    End Sub
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for the help, that does the trick!

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Guess I spoke a bit soon.
    Where is the workbook open event at, the code is working great, I just can't find where I need to put it.

    Thanks for the help

  6. #6
    Board Regular HunterN's Avatar
    Join Date
    Mar 2002
    Location
    Maryland
    Posts
    479
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi!

    When you go into VBEditor for the workbook click on 'ThisWorkbook' Select Workbook under the General dropdown list. It will
    create the subroutine for you. All you have to do is enter the macro that you want to run.

    Happy Days!

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
  •