How to auto-open the VBA Editor when Excel starts

To have the VBA Editor automatically open when Excel starts, add the code below to the ThisWorkbook module:

Private Sub Workbook_Open()
 
    Application.VBE.MainWindow.Visible = True
    Application.VBE.Windows("Immediate").Visible = True
    ThisWorkbook.VBProject.VBComponents("Module1").Activate
 
End Sub

Double-click ThisWorkbook and select Workbook in the left drop-down. The Open declaration should initiate and populate the first and last lines of a Workbook_Open procedure for you.

Then simply add the code above.

Add On-Workbook-Open Procedure in Excel
Add On-Workbook-Open Procedure in Excel

This is exceptionally handy when you’re working on a project for several days, or when you want the end user to be able to view the editor (for example, to watch the action happen in the Immediate Window while the bot is running).

Facebooktwittergoogle_plusredditlinkedintumblrFacebooktwittergoogle_plusredditlinkedintumblr

How to open Excel’s Developer tab and the Visual Basic Editor

Excel’s Developer tab does not show by default, so if you want to record macros or write macro code in VBA in the Visual Basic Editor, you’ll need to activate it

Open Excel’s File menu and click Options

Excel - Options in File menu
Excel – Options in File menu

Click Customize Ribbon

Excel - Customize Ribbon
Excel – click Customize Ribbon

Check the Developer box and click OK

Excel - check Developer box
Excel – check Developer box

Check the Developer tab…

Excel - click Developer tab
Excel – click Developer tab

To open the Visual Basic Editor, click the Visual Basic button, or shortcut keys ALT + F11.

Excel's Visual Basic Editor
Excel’s Visual Basic Editor
Facebooktwittergoogle_plusredditlinkedintumblrFacebooktwittergoogle_plusredditlinkedintumblr