Visual Basic Editor (VBE) in Excel
In Excel, VBA editor is the platform to write and edit the VBA code and by default, it is hidden and to use it, we need to activate it. Visual Basic Editor (VBE) is a separate application for Microsoft products like Excel, Word, and PowerPoint.
How to Open VBA Editor (VBE) in Excel?
We can open VBA editor in excel using 3 ways.
#1 – Using Developer Tab
In order to open the VBA editor, we can go to the Developer tab and click on Visual Basic Option as shown in the below picture.
#2 – Using Worksheet Tab
We can also open the Visual Basic Editor by using the Worksheet tab as well. To open this in the worksheet tab right-click on select view code.
#3 – Using Shortcut Key
Off all the three ways this is my favorite one, in fact, in don’t use the other two methods at all. To open Visual Basic Editor Window press the shortcut excel key ALT + F11.
This is toggle shortcut when you press it appears and if you press it again it will take back you to the active workbook.
Window of Visual Basic Editor (VBE) in Excel
If you are looking at the VBA window for the first time then it looks intimidating because of a completely new option and features you are seeing for the first time. When you look at the Visual Basic Editor window it has a retro look. Even though various new designs replaced the excel visibility Visual Basic still has its retro look from the beginning.
To open the visual basic editor window you can use any of the above three methods explained, I always use the shortcut key ALT + F11 to open the window.
We usually see 4 parts in Visual Basic Editor Window, below is the detailed explanation of the same.
- Menu Bar: Like how excel has menu ribbon similarly Visual Basic too has its own Menu Bar. It has all the available things in VBA. You can do settings, insert modules, toolbars, etc.
- Tool Bar: In the toolbar section we can save, we can head back to excel worksheet, we can redo, undo, run the macro, stop the macro, etc.
- Project Window: It is always on the left side of the editor. It has a Workbook name, worksheet name, and modules.
- Properties Window: Properties window is associated with Project Window. Here we can change the sheet name, we can change the module name, etc.. If you don’t see this window by default press F4 to activate it.
It is a floating window, we can move anywhere within the window. Using this window we can change all the properties of the selected object.
Adding Modules to VBA Editor
We write all the macro codes inside the module. By default you don’t get to see the module, we need to insert the VBA module.
Go to Insert > Module.
As soon as you click on Module you can see the newly created module just under the worksheet Project tool.
As soon as you insert the module you can see the white blank window on the right-hand side and it is called “Code Window”. In this window, we write all the VBA codes.
This is the basic and much-needed introduction to the Visual Basic Editor (VBE).
Working with Properties Window
One simple introduction you need here is how to work with “Properties Window”. Using this properties window we can change the properties of the objects here.
For example, if you want to change the name of the worksheet you can change here.
Similarly, you can change the module name as well.
This is the general overview of the Visual Basic Editor window. The more you use the Visual Basic Editor (VBE) you will slowly get to know the window.
This has been a guide to VBA Editor (VBE). Here we learn how to open Excel Visual Basic Editor and also how to use Visual Basic Editor (VBE) including Menu Bar, Tool Bar, Project window and Properties window with description. You may learn more about excel from the following articles –
- ISERROR Function in VBA
- Excel VBA Solver Function
- Screen Updating in Excel VBA
- Create VBA UserForm
- How to use Comment Block in VBA?
- VBA JOIN Function
- VBA Select Case Examples