![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Mar 2002
Posts: 29
|
Hey all, is there a way to make it so when you open an excel spreadsheet, the first thing it does is run a macro?
Thanks -Lewis lewis@lewisystems.net |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,758
|
Sure, put it in the Workbook_Open event.
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Admin Join Date: Feb 2002
Location: Minneapolis, Mn, USA
Posts: 9,639
|
Try this:
sub auto_open application.run("Your Macro Name") end sub Don't include the "sub". FYI, workbook_open goes into the "ThisWorkbook" module. The code above goes into any old normal module. Hope this helps. Cheers, Nate [ This Message was edited by: NateO on 2002-03-11 17:02 ] |
|
|
|
|
|
#4 |
|
Join Date: Mar 2002
Posts: 29
|
Where do I find the Workbook_Open event???
|
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Portland, OR USA
Posts: 1,368
|
Quote:
http://mrexcel.com/board/viewtopic.p...1960&forum=2&4 |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|