Autorun a macro on Excel startup

R

R Guzman

Does anyone know how I can execute a macro to auto-start once I open up an
Excel file?

Thanks.
 
B

Bondi

Hi,

You can put this in your excel file:

Private Sub Workbook_Open()
[Your code here]
End Sub

Regards,
Bondi
 
R

Roger Govier

Hi

If you name the macro Auto_open, then it will execute on opening the
file

Sub Auto_open()

your code here

End Sub
 
R

R Guzman

Thanks everyone for your solution.

Regards, R.

Roger Govier said:
Hi

If you name the macro Auto_open, then it will execute on opening the file

Sub Auto_open()

your code here

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top