Running Macro
Upcoming Power Excel Seminars
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Running Macro

  1. #1
    Guest

    Default

     
    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
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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


    HTH.

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

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
  •  

 

 
DMCA.com