Question Locked

Excel VBA ...

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
anyone of you guys knows how I can make a macro run automatically when I open the spreadsheet?

2 replies

by james_r_harrod

Hi, you can use the above mentioned Sub in VBScript.

All you do is:

1. Open the VBScript ('View > Toolbars > Visual Basic'. Then select the 'VisualBasic Editor' button on the toolbar which appears)

2. On the left, double click on 'ThisWorkbook' and it should automatically show 'Private Sub Workbook_Activate()' at the top.

3. Within this sub, enter the name of the macro you wish to run.

This will automatically run the macro from step 3, when you open the file.

Should you want the option to allow the user to enable/disable macros when opening the file, use 'Tools > Macro > Security' and set it to Medium.

Hope that helps and it's not too late!

This discussion is closed to new replies.