What is VBA
VBA or Visual Basic For Applications is a programming language that’s relatively easy to learn but massively powerful.
It enables you to get stuff done using the apps that you’re familiar with in Microsoft Office such as Word, Excel, Outlook and many more.
VBA is also a very practical programming language for Office Workers or PC users in general because if you’ve got Microsoft Office then, VBA is included as part of the install, meaning you don’t have to pay for anything extra.
If you write an application in VBA, you can be confident that it will run on any PC that’s got Microsoft Office.
What can you do with VBA?
Imagine a complex task, that you do every Day, Week or Month
Do you ever find that you’ve got to keep looking up how to do it, or that you make mistakes because it’s so incredibly boring and time consuming?
With VBA you can write code routines or macros that automatically do these steps from one puttton push or key press or multiple steps e.g. step 1, step 2 etc.
This can be done by typing the code or recording it using the "Macro Recorder".
You’ve now "encoded" a business rule, so you’ll never forget how to do the task again (Hint, press the macro button…)
Why Learn VBA?
The paragraphs above showed you a possible advantage of having a tedioius process automated for you, trouble is most people with these applications or macros have them written for them by someone else.
Following are some possible reasons why you might want to learn VBA yourself.
- Imagine how more powerful and secure in your job you’ll feel when you can confidelty write your own macros?
- Any tedious process can be easily automated by you, it’ll also help you understand the business better and possibly ask questions such as "is there a better way to do this task?", because when you start automating a process it makes you actually think about what you’re doing and possibly come up with improvements.
- You could become more valuable in your workplace as a "Go To" person for problem solving.
- You won’t have to wait to hire a developer to automate your process, you can start right now automating bit by bit and improving the automation as time goes by.
Why VBA rather than Python
Isn’t Python the hot new kid on the block and VBA is old, shouldn’t I learn a newer programming language?
It depends on why you want to learn it, if you want programming on your CV because that’s the way you want to go, well yes possibley C#, Python or Javascript are the way to go.
However if you not interested in being a programmer per se but rather want to build apps that get things done and can run on most peoples computers then VBA is absolutley the way to go for the following reasons…
- You can hit the ground running. Most working environments already have VBA loaded on their PC’s if they are using Microsoft Office.
- Most medium to large companies have their computers "locked down" meaning if you want to install another program such as Python on your work PC, you can’t without permission, which can be hard to get.
- When programming in VBA you don’t have to do it all youself, you can leverage the power of all the other Office application such as Word, Excel, Outlook and Access to do what they do best, rather than having to reinvent the wheel each time.
Case in Point..
Excel has charts, pivot tables and loads of other tools that you may already know how to manipulate, VBA can be used as an addon to make these tools even more powerful.
- It’s got a macro recorder, so you can record keystrokes if you’re a complete newbie.