Need to edge out the competition for your dream job? Train for certifications today.
Private Sub Workbook_Open()
Open in new window
from my web site
Add Excel VBA Code to a Workbook Module
This Excel VBA code is Workbook Event code, it should be added to the workbook code module:
Copy the Excel VBA code that you want to use
Select the workbook in which you want to store the code
Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
In the Project Explorer, find your workbook, and open the list of Microsoft Excel Objects
Right-click on the ThisWorkbook object, and choose View Code
Where the cursor is flashing, choose Edit -> Paste
Copy Excel VBA Code From a Different Workbook
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.