Startup macro?

H

hmmm...

How can I automatically run a macro when a workbook is
opened? Excel 97. Thanks.
 
C

Chip Pearson

Name the macro Auto_Open in a standard code module, or use the
Workbook_Open event procedure in the ThisWorkbook code module.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
G

Gord Dibben

Yes

Right-click on the Excel Icon at top left of screen. Select View Code.

In top left dialogue box you will see "General". Click on drop-down and
change to "Workbook".

These two lines will appear.

Private Sub Workbook_Open()

End Sub

Place your macro name or code between like so........

Private Sub Workbook_Open()
''macro name or code goes here
End Sub

Gord Dibben Excel MVP - XL97 SR2 & XL2002
 
H

hmmm...

Thank you.
-----Original Message-----
Yes

Right-click on the Excel Icon at top left of screen. Select View Code.

In top left dialogue box you will see "General". Click on drop-down and
change to "Workbook".

These two lines will appear.

Private Sub Workbook_Open()

End Sub

Place your macro name or code between like so........

Private Sub Workbook_Open()
''macro name or code goes here
End Sub

Gord Dibben Excel MVP - XL97 SR2 & XL2002
 
H

hmmm...

Thank you.
-----Original Message-----
Name the macro Auto_Open in a standard code module, or use the
Workbook_Open event procedure in the ThisWorkbook code module.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)





.
 

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