Python vs VBA: 6 Powerful Parameters Data Analysts Must Know

When it comes to programming languages, there are many of them, but I feel like both Python and VBA are all the way at the top in terms of their applicability and usability. So let’s compare these on 6 parameters that I have arbitrarily selected.

Python vs VBA

1. Ease of Learning

I find that both Python and VBA are some of the easiest languages to learn. I have learnt my fair share of programming languages. I know coding in Java, PHP, Python, VBA, C, C++, and a whole heap of other languages. But I find that among all of those languages, VBA and, to a good extent, Python are somewhat easy to get started with.

Why? Mainly because, especially when it comes to VBA, it almost feels like plain English. You’re talking to the computer, telling it things, and it will do stuff for you. It is more or less similar with Python, but it can get fairly complicated very quickly.

2. Immediate Application

When you are learning something new, you want to be able to feel the knowledge. You want to be able to test it immediately to see the results.

In that sense, I find that VBA is slightly better because I can take a simple thing that I’m doing in Excel or Word or Outlook, write a one- or two-line VBA script that will immediately automate it, and it will give me that immediate gratification.

You will feel like, yes, I have achieved something, I’ve learned something new, and I am able to do it. It will give you that confidence boost that, as a learner, you need when you start your journey. I would say Python will take a little more time.

3. How Many Different Places You Can Use a Language

Again, I find that VBA has a slight edge, simply because it is one programming language that is usable in Excel, Outlook, Word, Access, as well as the core background logic programming that is Visual Basic. It has got a whole heap of other things that you could use to build forms and computer applications.

Whereas Python, as a language, is kind of like a standalone language. You are always writing code within Python and then deploying it. But when you combine it with other components or libraries, you’re able to go and do wonderful things elsewhere.

So again, purely VBA will give you a slightly bigger bang for your buck if you are planning to work within Office applications.

4. How Forgiving a Language Is

When you are learning a new language, if you are learning in a world where all the rules are extremely strict and hard to follow, then you will not be able to get very far without first understanding all the rules.

In that sense, both VBA and Python are more forgiving. For example, you don’t have to declare your variables; you can just start using them. The language is more or less plain English; there is not too much syntax going on, you can just kind of do it, and it will work.

Python is even more forgiving than VBA, but both of them are fairly forgiving and easy to approach. So you can just jump in and start doing stuff within the language.

5. Where You Can Use It

Do you need to install something to use it, or is it readily available?

Again, in this situation, VBA is slightly better because it is already part of your Office suite of applications. You can straight away open Excel, Word, or Outlook and immediately write code without having to install or enable, or go through some security clearances.

Whereas I find that even in most advanced tech companies, sometimes installing a language like Python can require a couple of steps. You may have to get approval, or something needs to be installed on your computer. Again, this may not be 100% true depending on where you work and how your environment is set up, but usually, VBA is already there, whereas Python needs to be enabled.

Python vs VBA

6. Ability to Automate Things

Because the whole point of learning a programming language is so that we can simplify our work. When you are working in that direction, both Python and VBA offer amazing levels of automation capabilities.

What Should You Learn?

Well, it’s not like you’re having dinner and figuring out, should I have pizza or biryani? You can just pick one today and then do the second thing tomorrow. Oh, wait, maybe you can eat both. Would you call that a biryani or a pizza?

Here is what I feel. What you need to learn and use depends on your current life situation. I’m going to break this into 2 categories:

Category 1: Somebody Who Is Planning to Become a Data Analyst

If you are the first person, that is, you are in college, or you are going through some education, or you plan to transition into the data analyst category of jobs, then you should probably start by learning Python first.

This is simply because there is a lot more education and materials available on Python right now, and it is somewhat easier to learn when you are starting afresh, in my opinion.

The other reason why I feel Python is more applicable for someone like you is that, in order to learn and use VBA, you have to first write code that is applicable in your automation or Office situations. Whereas somebody who is outside, not really working in that world, will find it hard to imagine situations where VBA would be applicable.

On the other hand, Python is slightly different. It is a wider language. You are learning general programming skills along the way, and you can then take that and apply it to machine learning, working with larger data sets, or in various other situations.

So if you are somebody in that situation, then go and learn Python first.

Category 2: Somebody Who Is Already Working as a Data Analyst

But if you are already working as a data analyst and you are planning to add some more skills to enhance your workflow, then I suggest that you learn VBA first, especially if you are working in the Microsoft Office ecosystem.

That means you’re using Excel, Outlook, and Word on a day-to-day basis, and you do a lot of work in that space. Then learning VBA will give you immediate benefit. It will give you that confidence boost, it will give you that first taste of programming and automation, and later on, you can go and add Python to your skill set.

Python vs VBA

Final Advice (Python vs VBA)

Before wrapping up, let me share one important perspective that often gets overlooked when people debate programming languages. The other thing that I find somewhat uncomfortable, especially when you look online for information, is that there are a lot of arguments like “You should only learn Python,” “No, you should only learn VBA,” “You should only learn R,” or something else. There is no value in holding such tremendous loyalty towards any programming language. Instead, you should just pick and choose.

For example, I use VBA for my day-to-day purposes. I use Python for my day-to-day purposes. If there is a language that comes up tomorrow and I find it useful and valuable, I will learn and use it. Sometimes I might just learn for the sake of learning. That is the mindset that you need to develop. You should not have complete loyalty towards one and complete hatred towards others. Everything is equally valuable, so it’s best to just go and learn whatever works for you.

I hope that was helpful. It would be futile to just compare A versus B, so I want to throw a few more things into the mix. If you are planning to learn some sort of programming skills, then do not ignore the programming skills that are already there within the data analysis ecosystem. That means learning how to write better formulas. Many people think writing code is like really coding, but when you are writing a formula, you are also coding. You are telling Excel how you want your numbers to be analyzed. So learn how to do that better.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top