Hi everyone,
How do you run a macro automatically when you open up an Excel file?
Thanks in advance.
Hi everyone,
How do you run a macro automatically when you open up an Excel file?
Thanks in advance.
Place the name of your macro in the This Workbook object in the Workbook_Open event.
To do this right click the excel icon next to the File menu command and select view code. Select Workbook from the drop down box at the top middle of the VBE. The Workbook_Open even macro code will be inserted and you can paste your code there. Save the workbook and close it and the next time you open it the code will execute.
---------------------------------------------------
ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
To insert code into the VBE (Visual Basic Editor)
- Copy the code.
- Open workbook to paste code into.
- Right click any worksheet tab, select View Code
- VBE (Visual Basic Editor) opens to that sheets object
- You may change to another sheets object or the This Workbook object by double clicking it in the Project window
- In the blank space below the word "General" paste the copied code.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks