Stop searching. Start learning and developing your excel skills.
Macro
VBA
Formula
Function
Shortcut
Tricks

» » Visual Basic Editor (VBE)

Visual Basic Editor (VBE)

September 07, 2017 |
Its main function is to allow user to write and edit VBA code.

It is a separate application, will be open in separate window but must be opened together with excel then only it will run. There are 5 main components in VBE:

1. Menu Bar

Contains several drop-down menus. Each of the drop-down menus contains commands that you can use to interact and do things with the different components of the Visual Basic Editor.



2. Toolbar 

Contains on-screen buttons, icons, menus and other similar elements that you can use while working with the VBE. Default is standard toolbar.



3. Project Explorer

A set of modules.

What is Module?

A place to put your code.

There are 4 types of modules in VBE:

  1. Microsoft Excel Objects - contains event procedures for the worksheets and workbook
  2. Module - contains custom macros and function
  3. UserForm - contains code for the controls on a UserForm object
  4. Class Module - used to create new objects

UserForm and Class Module are dedicated module for their usage. Normally programmers will use Microsoft Excel Objects or Module to write their VBA codes. Most of the programmers like to use Modules only to write VBA codes compare to type 1 as Microsoft Excel Objects. Reasons:
  1. If you delete your sheet, you will lose all codes inside it
  2. If you export a sheet, you will export the codes as well
  3. If you duplicate a sheet, you will duplicate the code as well
  4. If you want to run the code behind a particular worksheet from another place, you have to fully qualify your calls and variables. It is complicated


4. Properties Window

Displays the properties of the object that is currently selected.



5. Code Window

A space to write VBA codes.


No comments:

Post a Comment