What Is VBA?
VBA, which stands for Visual Basic for Application, is a programming language developed to work with Microsoft’s Office applications (MS Word, MS Excel, MS Access, and MS PowerPoint). Which means with VBA, you can control, automate or manipulate any of these Microsoft’s Office Applications to do any task you want. For example, you might have a VBA program to import some data from a file to Excel, format and print some information at a particular interval, say every day.
However, this tutorial will only treat Excel VBA i.e. Programming Excel application with VBA.
VBA is an event-driven object-based programming language. Event-driven programming refers to the creation of a program that is designed to run when the user generates a stimulus. For example, a keystroke on your keyboard or a mouse click may trigger specific pieces of a program to execute i.e. some codes are executed in response to some event taking place,” nothing happens until something happens”.
Being object based means that components of an application are regarded or seen as objects. For example, in Excel, components like Workbooks, Worksheets, Cells, Charts, etc. are Objects and they can all be used and manipulated to a desired end.
The codes written in VBA are called macros. These codes are used to pass instructions to and also control the way Excel application behaves.
VBA is very simple and easy to learn, which means you do not necessarily need to have a programming background or experience to understand or start using VBA.
Also, if you are not familiar with the Object model of Excel, DO NOT PANIC as this Tutorial will treat all those, and with examples, in detail, later in the chapters.