Thread: Startup Macro
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Startup Macro

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


On Wed, 23 May 2007 17:13:01 -0700, JLatham <HelpFrom @
Jlathamsite.com.(removethis) wrote:

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.

"Gord Dibben" wrote:

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


On Wed, 23 May 2007 16:17:00 -0700, Max wrote:

I see the Workbook Open in VB. Can I do one by recording using
Tools/Macro/Record?



"Don Guillett" wrote:

Look in the ThisWorkbook module for workbook_open or create an auto_open
macro

--
Don Guillett
SalesAid Software

"Max" wrote in message
...
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.