Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Running Macro

  1. #1


    Hello folks
    Does anyone how to run the macro automatically?
    For example once I have recorded the macro, how can I set up the macro. So when the file can run the macro automatically when it is loaded to the excel?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Sunny, spring-like Hull
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)


    To run it automatically on opening the workbook, go into the VBA editor, double-click on the ThisWorkbook entry in the Project Explorer pane and change the left-hand dropdown in the right pane from General to Workbook. This will create the Private Sub Workbook_Open() sub for you. Type in Call and the name of your macro (eg if your macro was called MyMacro, the code would look like this: -

    Private Sub Workbook_Open()

    Call MyMacro

    End Sub


    [ This Message was edited by: Mudface on 2002-03-01 05:50 ]

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