Visual Basic terminology

Excel VBA Terminology
October 03, 2019

Excel VBA

Visual Basic for Applications is a derivative of the programming language Visual Basic. Each Office application has its own particular kind of VBA depending on the objects and operation of the application. For example, Microsoft uses worksheets while Microsoft Word works with documents. The following notes explain some of the key concepts in VBA programming.

Object Orientated and Procedure Driven

Visual Basic for Applications and Visual Basic are both object-orientated programming languages because they work with objects. Most of these objects appear on the screen, hence the term ‘visual’. They are also procedure-driven languages using commands and structures from the BASIC programming language to bind object statements into workable applications.

Objects, Properties, Methods and Events

In VBA an object is anything in an application that you can see and manipulate in some way. For example, you can manipulate a worksheet by adding rows, deleting columns, displaying gridlines, and so on. A worksheet is therefore an example of an object. Rows are also objects, as are columns too. These are child objects of the parent object – the worksheet. This way of organizing objects into a hierarchy is known as an object model.

Manipulate objects 1 of 3 ways:

  • Change the way an object looks or behaves by changing its properties
  • Make an object perform a task by using a method that is associated with the object
  • Run a procedure whenever a particular event happens to an object=

Objects therefore have properties, methods and events.

Real World Example…

Let’s look at a simple real-world analogy to get a better idea about objects, properties, methods and events. Consider a car: it is an object because you can see it and manipulate it. Its:

  • Properties are its physical characteristics such as its make, model, colour and so on
  • Methods define what you can do with the car such as reversing, accelerating, turning, stopping and so on
  • Events are the actions that happen to the car that generate an automatic response from the car. For example, if you remove the keys from the ignition while the car’s headlights are on (event), most cars will sound a warning alarm or turn off the lights (response).

The Active Object

In VBA, active describes the object item that you’re currently working on.

For example, the worksheet cell that you’re editing or formatting in Excel is the active cell. The workbook that you are currently working on is said to be the active workbook. The object that is currently active is said to have the focus.

This is an important concept to understand because most of your VBA programming will be performing an action on a particular object. If you don't identify that object correctly, you may find that Excel shifts focus behind the scenes to a different object and your program will fail.

If you would like to learn more about our Excel VBA courses click here.

Why choose Nexacu?

Valued by Individuals

4.8/5
Over 15837 Reviews
Training is really good. Topics selected were good and all questions were answered patiently. Will prefer this facilitator for the next sessions. -Power BI Intermediate Canberra
suz - Power BI Intermediate, .
Great course, great trainer learned alot -Analysis & Dashboards Brisbane
Karen - Analysis & Dashboards, .
Found it to be very informative. Now I need to go and put it into action. Jagg was an excellent trainer, just the right level of understanding of the differing skills in the room. -Power BI Intermediate Adelaide
John - Power BI Intermediate, .
Thank you -Power BI Intermediate Canberra
Anon - Power BI Intermediate, .
Great -Power BI Intermediate Adelaide
David - Power BI Intermediate, .
Good trainer who made sure I understood everything and took the time to cover any queries I had. Very interactive which really helped my understanding. -Analysis & Dashboards Brisbane
Amy - Analysis & Dashboards, .
Thank you -Analysis & Dashboards Brisbane
LGC - Analysis & Dashboards, .
Excellent Trainer -Power BI Intermediate Canberra
Prakash - Power BI Intermediate, .
Thanks! -Power BI Intermediate Canberra
GP - Power BI Intermediate, .
Thanks. Good efficient course and engaging instructor! -Power BI Intermediate Canberra
Elise - Power BI Intermediate, .
Great knowledge of the trainer, who provided data insight and visualisation advice for various audience -Power BI Beginner Melbourne
Zoe - Power BI Beginner, .
Comprehensive and great for beginners -Power BI Beginner Melbourne
mlim - Power BI Beginner, .
clear teaching -Power BI Beginner Melbourne
Lay - Power BI Beginner, .
thanks John -Power BI Beginner Melbourne
dh - Power BI Beginner, .
John was great to work with. Really enjoyed his style and patience with us. Thanks John! -Power BI Beginner Melbourne
David - Power BI Beginner, .
Good pace and engagement. Answered questions well. Friendly and pleasant. -Power BI Beginner Melbourne
John - Power BI Beginner, .
A thorough overview of analysis and dashboards and the intrinsic possibilities -Analysis & Dashboards Melbourne
LUMART - Analysis & Dashboards, .
Tim was very clear and easy to understand and took the time to understand what we did for our jobs and tried to then give useful examples as to how we could use these tools in our work. -Analysis & Dashboards Melbourne
Nicola - Analysis & Dashboards, .
Very insightful session into Power BI, will definitely come back for another level so I could leverage the tool for the business -Power BI Beginner Melbourne
Tham - Power BI Beginner, .
Good course -Analysis & Dashboards Melbourne
Lauren - Analysis & Dashboards, .

Trusted by Business

Procured by Government

Map of Australia