First Access the Visual Basic Editor by selecting Tools then Macros
then Visual Basic Editor on your Excel Menu.
Go Into the THISWORKBOOK module of the worksheet.
you will see two dropdown bars.
click the left dropdown and select workbook
click the right dropdown and select Open
Then put the name of the macro you'd like to run.
It will run whenever the workbook is opened.
Create a new modules in the VBA Editor
Start the code for the module with:
Sub Auto_Open()
Then write your code,
Finish with
End Sub
And everything you have written will be executed whenever that workbook is
opened.
Alternatively,
If you want to record your Macro then go to the Record New Macro dialog as
usual, and when you are asked to name your macro call it Auto_Open and it
will then execute when the workbook is opened.
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.