How do I get a macro to run whenever an Excel file is opened?
Thank you,
Gary
How do I get a macro to run whenever an Excel file is opened?
Thank you,
Gary
Hi Gary,
Welcome to the forum.
To achieve that, place the following code on ThisWorkbook Module. To do that, press Alt+F11 to open VB Editor --> On the Project pane, double click ThisWorkbook and place the following code into the opened code window --> Save your workbook as Macro-Enabled Workbook.
Please Login or Register to view this content.
Regards
sktneer
Treat people the way you want to be treated. Talk to people the way you want to be talked to.
Respect is earned NOT given.
Thanks sktneer. It worked.
Now I need a macro that executes when the workbook is closed. I tried replacing "open" with "close" in the macro above, but it didn't work.
gary
My code generates a message box when the file is open. I don't know if this is possible, but I'd like to:
1. Add three buttons to the message box
2. button1: closes the message box
3. button2: triggers a timer so the message box lingers for 5 minutes. At the end of that time, I either click button1 or, if I don't, a second message box pops up that more emphatically (can just be the text of the box, as in ! and CAPS) states that the task in hand has to get done
4. button3: triggers a macro that shows a form with its own check boxes (each with text next to it). This form will only go away when all 4 or 5 checkboxes get checked)
I attached an example I made in Word.
Gary
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks