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.

What is Remote Training?

Valued by Individuals

 

4.8/5
Over 21481 Reviews
Good Overview - got what i needed -Office365 Beginner Melbourne
robert - Office365 Beginner, .
Got a lot of today thanks -Office365 Beginner Sydney
Courtney - Office365 Beginner, .
Excellent Course. Michael was very good at explaining the concepts. -Office365 Beginner Sydney
Mark - Office365 Beginner, .
easy to follow, friendly.. -Excel Beginner Adelaide
Shane - Excel Beginner, .
good course just need to apply to cement knowledge -Excel Beginner Adelaide
Mathew - Excel Beginner, .
Very good course, well presented and communicated throughout -Excel Beginner Adelaide
Brian - Excel Beginner, .
very informative and explained clearly -Excel Beginner Adelaide
Richard - Excel Beginner, .
great start to learning your way around -Excel Beginner Adelaide
Daniel - Excel Beginner, .
The course was fairly concise and easily consumed. Steven did a great job of adjusting the material and delivery for the Army environment, which can be less than accommodating at times. I personally found the material to be very simple and easily understood, but some of my classmates were not quite on the same page so I think it was appropriate for the audience receiving it. -SharePoint Site Owner Brisbane
Joel - SharePoint Site Owner, .
The training facilitated by Steven was to a very high standard. Although some of our course members were interrupted by some real time events happening in the background, Steven was able to adapt and focus on delivering some good training. He has an excellent instructor presence. -SharePoint Site Owner Brisbane
Phil - SharePoint Site Owner, .
Steven was a excellent instructor. He was able to tailor his package to our requirements and remained flexible to our demanding work requirements. His lessons were well developed and his instructional style was patient and professional. -SharePoint Site Owner Brisbane
Andrew - SharePoint Site Owner, .
Jagg was an excellent trainer - very patient, had lots of options for people who didn't have the newest versions. I feel really confident about what I learnt today and I am very happy I did this course! -Power BI Beginner Adelaide
Melissa - Power BI Beginner, .
Excellent! Very knowledgeable instructor. -Power BI Beginner Adelaide
Jason - Power BI Beginner, .
Great course, very informative. Great instructor, very helpful -Power BI Beginner Adelaide
Sarah - Power BI Beginner, .
Great session, moves at a good pace with support when needed. Thanks -Power BI Beginner Adelaide
Matthew - Power BI Beginner, .
Excellent! -Microsoft Applications - Customised Sydney
Candice - Microsoft Applications - Customised, .
Very helpful -Microsoft Applications - Customised Sydney
Janet - Microsoft Applications - Customised, .
The learning environment and facilities are great. Ken knew the course content and is a friendly trainer.. -SharePoint Site Owner Melbourne
Robbie - SharePoint Site Owner, .
Thank you Ken Great 2 day of learning lots of information, looking forward to making our New Company SharePoint Site -SharePoint Site Owner Melbourne
Natasha - SharePoint Site Owner, .
Thank you Ken, I feel a lot more empowered and up-skilled with regards to SharePoint. I am looking forward to supporting my organisation to leverage SharePoint as one of collaboration and information management tools. -SharePoint Site Owner Melbourne
Annita - SharePoint Site Owner, .

Trusted by Business

Procured by Government

Map of Australia