Macro that automatically runs when workbook is opened

kluitna

Board Regular
Joined
Mar 10, 2002
Messages
75
I know this is a question that has already been answered some where in the forum. because I have seen it, but can not locate it for the life of me.

What I want to do is just have a macro run whenever a given workbook is opened. How does one go about doing that?

Thanks in advance for the help
Paul
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Place the call function to your macro in the Workbook_Open event:

Private Sub Workbook_Open()
Call YourMacroName
End Sub
 
Upvote 0
Guess I spoke a bit soon.
Where is the workbook open event at, the code is working great, I just can't find where I need to put it.

Thanks for the help
 
Upvote 0
Hi!

When you go into VBEditor for the workbook click on 'ThisWorkbook' Select Workbook under the General dropdown list. It will
create the subroutine for you. All you have to do is enter the macro that you want to run.

Happy Days!
 
Upvote 0

Forum statistics

Threads
1,214,619
Messages
6,120,550
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top