Auto macro question

  • Thread starter Thread starter OceansideDJ
  • Start date Start date
O

OceansideDJ

How can I rename a macro in Excel 2000 to run automatically when the
spreadsheet opens?

Thanks,

Mike
 
Mike, you can name it auto_open or put your code in the workbook open event

Sub Auto_Open()

'your code here

End Sub

or in thisworkbook


Private Sub Workbook_Open()

'your code here

End Sub



--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
 
Use the Workbooks_Open event and call you macro from there. This sub should
be put in the ThisWorkbook module (select it from the dropdowns at the top
of the module to insure it is declared properly.

See Chip Pearson's page on Events:

http://www.cpearson.com/excel/events.htm
 
You need to add this event code plus you macro code to the this Workbook
module of your worksheet.

Private Sub Workbook_Open()

'Your code here

End Sub
 
Mike,
In a standard module, try this...

Sub Auto_Open()
....
End Sub

OR

In the "ThisWorkbook" module...

Private Sub Workbook_Open()
....
End Sub

Dale
 

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