Startup Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a startup or automatic macro in Excel 2003. I have looked
in Help, VB Help, and on-line KB to no avail.

How do I begin? How do I tell Excel that this is an auto macro, not just a
regular macro?

Thanks in advance.
 
Record the macro then wrap it inside the Workbook_Open

i.e.

Sub Macro1()
'do the steps
End Sub

In Thisworkbook hit Workbook in left-side dialog to get

Private Sub Workbook_Open()

End Sub

Stick Macro1 between the lines or copy the "steps" from Macro1.

Private Sub Workbook_Open()
Macro1
End Sub

Private Sub Workbook_Open()
'do the steps
End Sub

Either one will work, but the second method means you don't have to save Macro1


Gord Dibben MS Excel MVP
 
Might even skip a step - when you start recording your macro and have a
prompt to give it a name, enter Auto_Open as the name. Then record your
macro. It'll run when you open the workbook - still works even in 2007!

But somehow associating it with the Workbook_Open() event is generally the
standard way of doing things these days.
 
Good point Jerry

Never thought of naming to Auto_open and leaving in the general module.

I'm sure happy there are many of us around here for alternative ideas<g>


Gord
 
Let's not forget

Workbooks.Open(workbookname & ".xls")
won't run the auto_open

Workbooks.Open(workbookname & ".xls").RunAutoMacros xlAutoOpen
will
 
Back
Top