How to open visual basic editor and save a macro in excel


Why the visual basic editor?

Visual Basic editor(VBE) is a powerful tool in excel used for creating, managing scripts, in fact, the macros you record is saved as scripts in this editor and it is important to modify recorded macros.

Why scripts? scripts help us to finish complex tasks like creating a user-defined function apart from the excel's inbuilt functions, create new logic to your form controls, automate tasks to avoid few clicks, etc. You can also add codes sheet wise and to the complete workbook or you can create modules to store your codes which can be imported and exported to other workbooks.

The visual basic editor has a vast reference library and also if you want any reference regarding any properties or methods you can learn about those properties and methods easily inside its library itself.

Let us see how to open the visual basic editor?

Method 1:

First, through the developer tab, click developer menu from the menubar and click on a visual basic editor from the list developer options. If the developer tab is not visible. You can enable the developer tab by right-clicking on the menu bar and select customize the ribbon option. On the appearing windows make sure the developer tab checkbox is checked which is in the right pane of the window.

Method 2:

The second way to open visual basic editor is through a shortcut key Alt + F11, this method is highly recommended as it saves few clicks.

How to save a macro?

Every workbook with macros should be saved in a macro-enabled workbook type, which is in .xlsm extension. A workbook saved in .xlsx format won't run macros because simply macro is not enabled in it. Below video shows how to save a macro.

Another way of saving a macro is through personal.xlsb, which is a hidden workbook in excel. the importance of saving it there is that you can access all your macros in all your workbooks. The way it works is, you should load all your macros into the personal.xlsb and save it, excels by defaults loads personal.xlsb every time at its startup making it possible to access.

Video: How to open visual basic editor and save a macro in excel

Share on:
Most Popular