Startup macro?

H

hmmm...

How can I automatically run a macro when a workbook is
opened? Excel 97. Thanks.
 
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
 
Top