ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto macro question (https://www.excelbanter.com/excel-programming/314428-auto-macro-question.html)

OceansideDJ

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

Thanks,

Mike

Paul B[_8_]

Auto macro question
 
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 **


"OceansideDJ" wrote in message
...
How can I rename a macro in Excel 2000 to run automatically when the
spreadsheet opens?

Thanks,

Mike




Tom Ogilvy

Auto macro question
 
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

--
Regards,
Tom Ogilvy


"OceansideDJ" wrote in message
...
How can I rename a macro in Excel 2000 to run automatically when the
spreadsheet opens?

Thanks,

Mike




CBrine[_4_]

Auto macro question
 
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

"OceansideDJ" wrote:

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

Thanks,

Mike


Coach Preuss

Auto macro question
 
Mike,
In a standard module, try this...

Sub Auto_Open()
....
End Sub

OR

In the "ThisWorkbook" module...

Private Sub Workbook_Open()
....
End Sub

Dale

"OceansideDJ" wrote:

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

Thanks,

Mike



All times are GMT +1. The time now is 12:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com