+ Reply to Thread
Results 1 to 5 of 5

Running Macros Automatically

  1. #1
    Registered User
    Join Date
    11-12-2006
    Posts
    7

    Question Running Macros Automatically

    Is there a way to have a macro run automatically when the workbook is opened. I know I can go to the macro and click run macro or I can create a hot key that will run the macro but what I really want is for it to run itself as soon as the workbook is opened. Any help would be greatly appreciated. Thanks in advance.

  2. #2
    Registered User
    Join Date
    11-04-2006
    Posts
    30
    You can put the macro in the workbook_open event. Instead of creating the macro in a module, you can put the code here. Or, you can still put the code in a module and then just call it from here.


    Private Sub Workbook_Open()

    End Sub

  3. #3
    Registered User
    Join Date
    11-12-2006
    Posts
    7

    Still confused

    Where would I put the code

    Private Sub Workbook_Open()

    End Sub

    I'm new to macros, and not sure what you are telling me. Sorry

  4. #4
    Registered User
    Join Date
    11-04-2006
    Posts
    30
    Go into the edit (ALT-F11).

    Open up the Microsoft Excel Objects and double-click on ThisWorkbook. This is probably empty. You can put the

    Private Sub Workbook_Open()

    End Sub

    in there. You can then either put your macro code in there, or you can put...

    Call MACRONAME

    in there. I think this should work for you.

  5. #5
    Registered User
    Join Date
    11-12-2006
    Posts
    7

    Smile Thanks a million

    You are the MAN.

+ 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