MACRO TO RUN ON FILE OPEN

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

Guest

If I want a macro to automatically run when the file is opened what code do I
need to insert into the macro?
Jenn
 
In the 'This Workbook' window in the VB editor,

Private Sub Workbook_Open ()
'Your code here
End Sub

Regards,
Alan.
 
Alan:
I am sorry if I seem like an idiot, its been a while for me since VBA...
Here is the code I am trying to use:
Private Sub Workbook_Open()
Sub Open_ValList()
'
' Open_ValList Macro
' Macro recorded 11/16/2005 by J.G.
'

'
Workbooks.Open Filename:="P:\0-Admin Files\Time Sheets - 2005\Lists.xls"
End Sub
End Sub
WHAT AM I DOING WRONG?
Thankyou so much for your help (in advance)
Jenn
 
Never mind Alan I got it- in case you didn't know another way to run a macro
on file open is to name it Auto_Open
Thanks for your help
Jenn
 
Leave the macro ValList in the module its in, then,

Private Sub Workbook_Open ()
Call ValList
End Sub

or just,

Private Sub Workbook_Open ()
ValList
End Sub

Regards,
Alan.

PS, I do know about Auto_Open but thanks anyway!
 
Back
Top