All courses available in-class or via remote login

Visual Basic terminology

Excel VBA Terminology

January 25, 2018

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.

Contact Us

What is Remote Training?

Valued by Individuals

4.8/5
Over 23083 Reviews
The course provided a great base to continue my learning with Power BI. -Power BI Beginner Melbourne
Chris - Power BI Beginner, .
John was direct and concise with his delivery. As a Supervisor I am now more prepared to request reports of the types I require . Long day but excellent information and paced well. Thank you -Power BI Beginner Parramatta
Glenda - Power BI Beginner, .
Very interesting course. John was great but the course was a lot to take in one day, maybe it should be split into 2 sessions over 2 days. -Power BI Beginner Melbourne
kaan - Power BI Beginner, .
Very informative and easy to follow. Patient and communicated well Now have a better understanding of how to set up Power BI reports. -Power BI Beginner Melbourne
Melanie - Power BI Beginner, .
Steven has a great knowledge and great present skill for the day. the course was well designed. satisfied with everything. Thank you -Power BI Beginner Brisbane
Megan - Power BI Beginner, .
Hands on, enjoyable training. Thank you Steven -Power BI Beginner Brisbane
Catalina - Power BI Beginner, .
Good intro into the world of Power BI. Hope to be able to put it into practice straight away -Power BI Beginner Brisbane
Raelene - Power BI Beginner, .
Useful course and excellent trainer -Power BI Beginner Brisbane
Rajesh - Power BI Beginner, .
Course was well structured and paced. Steven was a knowledgeable instructor. -Power BI Beginner Brisbane
Brianna - Power BI Beginner, .
Really good fun and informative with Steven, as always. -Power BI Beginner Brisbane
James - Power BI Beginner, .
Thank you! See you again for intermediate and advanced -Excel Beginner Brisbane
JULIE - Excel Beginner, .
Jason was an awesome instructor that had my full attention for the duration of the course. I really enjoyed the hands on experience & being able to follow along with my own laptop. Thank you for an amazing course! -Excel Beginner Brisbane
Emma - Excel Beginner, .
Well delivered class! Definitely learnt a lot and had a laugh which was good. Thank you Jason, you're an excellent teacher. -Excel Beginner Brisbane
Layla - Excel Beginner, .
Very much enjoyed the course, easy to understand and follow, I feel like I have a better understanding of the program now so thank you Jason! -Excel Beginner Brisbane
Serena - Excel Beginner, .
Excellent course -Excel Beginner Brisbane
Nahan - Excel Beginner, .
AMAZING! So grateful I completed this. See you for intermediate and advanced soon :) -Excel Beginner Remote Online
JULIE - Excel Beginner, .
made sense of what i have been trying to achieve since moving into an office environment -Excel Beginner Brisbane
Joseph - Excel Beginner, .
Excellent trainer -Excel Beginner Brisbane
Peter - Excel Beginner, .
Really helpful - good teacher -Excel Beginner Brisbane
Martin - Excel Beginner, .
Great session with Jason as always -Excel Advanced Remote Online
Rebecca - Excel Advanced, .

Trusted by Business

Procured by Government

Map of Australia