Visual Basic Editor

VBA is an object-orientated programming language that is identical to the Visual Basic programming language in the way it is structured and in the way that it handles objects.
If you learn how to use VBA in Excel, you will be able to use VBA in all the Office applications.
Each Office applications has a different set of objects that they expose to VBA.
To program an application, you need to be familiar with that particular object model.
The object model is a hierarchy of all the objects that you find in the application.

Visual Basic is the common language behind all the Microsoft Office applications (Excel, Word, PowerPoint, Outlook, Access)
This langauge is built-in as standard to all of the Microsoft Office applications so no extra software needs to be purchased.
There are infact many tasks that can be performed in code that cannot be performed through the user interface.

Built-in Keywords
Built-in Functions
Built-in Statements
Built-in Operators

Inorder to understand macros and to be able to modify your macros you need to understand the Visual Basic Editor (VBE).
The Visual Basic Editor has its own seperate window and looks like an application in its own right.
The VBE is also know as the Visual Basic Integrated Development Environment.
All of the Microsoft Office applications have a Visual Basic Editor built-in.

Displaying the Visual Basic Editor

There are several ways to display the Visual Basic Editor:
1) Select (Developer tab, Visual Basic).
2) Press (Alt + F11) to quickly toggle between your application and the VBE.
3) Right click on an Excel worksheet tab and select "View Code"


Menu Bar
Project Explorer
Properties Window
Code Window
Immediate Window - Displaying variables and executing lines of code.
Watch Window - Displays the current value of variables as you step through the code.
Locals Window - Displays all the variables used in the current subroutine.
Call Stack - Displays a list of all the procedures and functions in the order they have been called.

Arranging Windows

Most of the windows in the IDE including the Project, Properties and Immediate windows can be either docked or floating.
You can also dock the windows to any side of your application window.

You can close the windows and move them around to create more space for the code window.
A docked window is attached or anchored to an edge of the main window.
When a dockable window is moved it snaps to an anchored position.
A floating window on the other hand can be placed anywhere on the screen. You can change the state of your windows from (Tools > Options)(Docking tab).

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopNext