Previously Excel Consulting

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.

Why choose Nexacu?

Valued by Individuals

 

4.8/5
Over 18890 Reviews
WELL SPOKEN -Excel Advanced Perth
RENAE - Excel Advanced, .
Course was very easy to follow and well paced. Steven was excellent at explaining everything and answering questions etc. -SharePoint Site Owner Brisbane
Louise - SharePoint Site Owner, .
Thank you for a very engaging training course Steven. Much appreciate all you knowledge and sharing you experience. -SharePoint Site Owner Brisbane
Ruth - SharePoint Site Owner, .
Great course highly recommended. -SharePoint Site Owner Brisbane
Andrew - SharePoint Site Owner, .
Great Course. Need better Coffee! :) -SharePoint Site Owner Brisbane
Rod - SharePoint Site Owner, .
Michael has offered a comprehensive training session with some real life suggestions. He was easy to understand and always happy to help. -SharePoint Site Owner Sydney
Claudio - SharePoint Site Owner, .
I thought the course was very informative. So much information and such little time. Could easily be a 3 day course. Thankyou Michael! -SharePoint Site Owner Sydney
Ben - SharePoint Site Owner, .
Very informative and interactive -SharePoint Site Owner Sydney
Arlene - SharePoint Site Owner, .
Great course with real life applications in mind. Course Instructor was clear and easy to understand while working at a pace which was comfortable. -Excel Macros/VBA 2 Day Brisbane
MIchael - Excel Macros/VBA 2 Day, .
Great energy by the instructor Ken. Material is great and up to date. Learned lots of new thing, tips, tricks. I would be interested if there will be any advanced training in the near future. -Power Apps Intermediate Melbourne
Ray - Power Apps Intermediate, .
John was a great instructor, the course was easy to understand and follow. John was also a entertaining instructor. I also learnt skills that i believe i can use straight away into my day to day job and enhance my projects. -Excel Macros/VBA 2 Day Melbourne
Katie - Excel Macros/VBA 2 Day, .
John is great! -Excel Macros/VBA 2 Day Melbourne
Peter - Excel Macros/VBA 2 Day, .
Great cousre -Project Advanced Canberra
matt - Project Advanced, .
Great course -Project Advanced Canberra
VI - Project Advanced, .
Greg was very knowledgeable in the course work, and answered all questions with various options relevant to my feild. Would recommend course to others. -Project Advanced Canberra
Brendan - Project Advanced, .
Danny was excellent. He was clear and thorough in his explanation. The course was very beneficial to our group. -Excel Advanced Sydney
Tanya - Excel Advanced, .
Thank you for guiding us through difficult concepts and customizing the course to our needs. We had a great time and really found the course to be very beneficial. Danny is an excellent trainer. -Excel Advanced Sydney
Marieke - Excel Advanced, .
lot of information -Excel Intermediate Perth
Heather - Excel Intermediate, .
excellent course, easy to understand and having the book to take home is useful in practice -Excel Intermediate Perth
Julie - Excel Intermediate, .
great teaching -Excel Intermediate Perth
Lisa - Excel Intermediate, .

Trusted by Business

Procured by Government

Map of Australia