sure, simply
1. Go to the Visual Basic Editor by pressing the keys Alt+F11.
2. From the Project Explorer, double-click over the ThisWorkbook object
3. That will execute an event window for you. At the top of the new code window, you will see the word 'General'. Select the drop down where you see general and select 'Workbook'.
4. You will notice that Excel VBA assumes the Open event. That means whatever code you insert in this procedure will execute automatically when the workbook is opened.
Private Sub Workbook_Open()
MsgBox "say hello"
End Sub
How do you edit the macro file without running it since you've set it to run when you open it? I have created a macro that will automatically send the files through email but I need to edit it without sending the emails.
sure, simply
1. Go to the Visual Basic Editor by pressing the keys Alt+F11.
2. From the Project Explorer, double-click over the ThisWorkbook object
3. That will execute an event window for you. At the top of the new code window, you will see the word 'General'. Select the drop down where you see general and select 'Workbook'.
4. You will notice that Excel VBA assumes the Open event. That means whatever code you insert in this procedure will execute automatically when the workbook is opened.
Private Sub Workbook_Open()
MsgBox "say hello"
End Sub