Galina has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
Macro to run on file opening
Hi! I would like my macro to run when I open the file. Can I code that? Thanks!
RE: macro to run on file opening
Hi Galina
Thanks for your question
This is easy to do
You need to write your code in the open event of the workbook object
In your VBE look at your project explorer. You will see a module for each worksheet, and one for the workbook. Double click on the workbook module. Above the code window click on the object list (Left most combo, currently showing "General"). Select Workbook from the list.
In the right most (procedure) combo box, choose Open. You will now have created an On Open event. Any code you place in here will run when the workbook opens
Hope this is useful
Regards
stephen