Excel auto-start macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you get a macro to automatically execute when you open a workbook?
 
Hi
tow ways:
1. Rename your macro to Auto_Open()
2. Put your code in the workbook_open() event

--
Regards
Frank Kabel
Frankfurt, Germany

RDCLARK said:
How do you get a macro to automatically execute when you open a
workbook?
 
Hi
Assuming you've got XL97 or above, double click on the ThisWorkbook object
(for the workbook concerned) in VBE project window to create a module. In
the module window select Workbook and Open from the drop-down lists. The
following
code will automatically be generated:

Private Sub Workbook_Open()

End Sub

Insert the code you want and save.

Regards

Paul
 

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

Back
Top