Attend courses from home - All courses REMOTE from April 1 - April 30

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 20105 Reviews
I am excited about PowerPoint after completing this course with John. I was advised by Ella to do this course and it was good advice. Thanks again John! -PowerPoint Level 2 Sydney
Paul - PowerPoint Level 2, .
Awesome class today John. Really informative and thoroughly enjoyed the topics especially the Video and Master Slides components, I will be able to use these for upcoming projects. -PowerPoint Level 2 Sydney
Dom - PowerPoint Level 2, .
Great course. John is an awesome trainer. Had a great learning. Thank you very much. -PowerPoint Level 2 Sydney
Manisha - PowerPoint Level 2, .
Great course very in depth, covered all basis, great templates -PowerPoint Level 2 Sydney
Shin - PowerPoint Level 2, .
john was extremely informative and made the day go quickly. helped me regain a lot of forgotten knowledge -PowerPoint Level 2 Sydney
Nathan - PowerPoint Level 2, .
Jagmohan presented well and explained in detail. I found the content to be a little basic for what i was expecting. -Word Intermediate Sydney
Shanay - Word Intermediate, .
Was really informative, easy to follow and Ken did a great job given a few technical issues beyond control -Teams for Collaboration Adelaide
Melissa - Teams for Collaboration, .
Lesson went really well - had some time left so Ken went through some additional apps at our request. Very insightful. -Teams for Collaboration Adelaide
Lucia - Teams for Collaboration, .
Great Trainer. Very impressed. Learned a lot. -Power BI Beginner Melbourne
Andrew - Power BI Beginner, .
Great course, highly recommend. -Excel Intermediate Canberra
Chandre - Excel Intermediate, .
Great course, very informative! Excited to apply what I have learnt at work. -Excel Intermediate Canberra
Polly - Excel Intermediate, .
Enjoyed course just couple of issues with remote connection in that I could hear and see course, but could not ask questions for a period of time. Terry was very helpful in sorting out issue during the lunch break.. -Excel Intermediate Canberra
Mary - Excel Intermediate, .
For a session that is originally designed for face to face delivery, the online learning (aside from a few technological issues) was informative and covered a broad range of topics in detail. Jag explained everything really well and made sure that all participants were following and always stopped to help if anyone fell behind or were having issues. Thank you! -Excel Intermediate Canberra
Katie - Excel Intermediate, .
Thank you Michael for a very comprehensive introduction to Power BI. I appreciated your explanations regarding why we do certain actions. You also re-emphasised points by repeating them as there is a lot to process through in one lesson. -Power BI Beginner Melbourne
Matthew - Power BI Beginner, .
Good -Excel Macros/VBA 2 Day Sydney
Qing - Excel Macros/VBA 2 Day, .
Course was very informative. Thoroughly enjoyed. -SharePoint Site Owner Perth
Shannon - SharePoint Site Owner, .
Great course - Dominic was a engaging instructor considering the limitations of online learning -SharePoint Site Owner Perth
Alyce - SharePoint Site Owner, .
Michael was an excellent demonstrator, and engaged us well and answered all our questions. Thank you Michael! -Power BI Beginner Melbourne
Vatsal - Power BI Beginner, .
Excellent - great pace and clear instructions - really useful! Will send others from my team. Cheers Michael Sean -Power BI Beginner Melbourne
Sean - Power BI Beginner, .
Very detailed. Might be good to have a shorter higher level course, i found this course to be a little too detailed, as I am already very familiar with SharePoint. More time on Flow would have been good and less time on other functions -SharePoint Site Owner Brisbane
Jodie - SharePoint Site Owner, .

Trusted by Business

Procured by Government

Map of Australia