Run Macro on sworkbook open

  • Thread starter Thread starter Ian
  • Start date Start date
I

Ian

HI,

How do I get a macro to run as soon as the workbook opens?

Thanks
Ian
 
Hi Ian
two ways:
1. In your workbook module (not in a standard module) use the
Workbook_Open() event procedure

2. Rename your macro to Auto_Open()
 
-----Original Message-----
HI,

How do I get a macro to run as soon as the workbook opens?

Thanks
Ian
.

Hi Ian,

The function I use is:

Private Sub Workbook_Open()

'main body of your macro

End Sub

I wouldnt be the worlds biggest VBA expert but as far as I
know this has to be contained inside the ThisWorkbook part
of the VBAProject

Hope that help,

John
 
big thanks to both of you ! Sorted!
-----Original Message-----


Hi Ian,

The function I use is:

Private Sub Workbook_Open()

'main body of your macro

End Sub

I wouldnt be the worlds biggest VBA expert but as far as I
know this has to be contained inside the ThisWorkbook part
of the VBAProject

Hope that help,

John

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top