I need to run a macro when a worksheet is opened. I have the macro written, I just can't find the option to run it when a particular worksheet is accessed.
WorkSHEET or workBOOK ???
You can use the worksheet_activate event for a worksheet
Right click on the sheet tab and choose "View code"
then, change the right hand drop down to "Activate" and pop the name of the macro you want to run between the start and finish
...and delete the selection change event sub that will be automatically generated when you hit "View Code"
For workBOOK - use either the workbook_open event (go to VBE, double click on the "workbook" icon in your "projects" list) or create a sub called Auto_open in a standard module Rgds
Geoff
Geoff,
I'm a bit hazy on the last method. I too have a spreadsheet/workbook that I'd like a macro to run when the spreadsheet is opened. The spreadsheet/workbook contains 3 worksheets. What do I need to do to get the macro to run.
Many thanks
Marc
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.