AutomateWorkflows
All articles
Nov 6, 20266 min read

VBA vs. Python for Excel Automation: Which to Learn First

Both tools automate Excel. One lives inside the file; the other lives outside it. Picking the right one first matters more than people think.

ExcelVBAPythonMacros

Every few months someone on LinkedIn argues that VBA is dead and Python killed it. They're wrong. VBA runs on half the critical spreadsheets in Indian banks, insurance companies and accounting firms — and it's not going anywhere soon. The real question is not 'which one should I use forever' but 'which one should I learn first'. The answer depends on where you sit and what you do.

What each one actually is

VBA

Visual Basic for Applications. A scripting language that lives inside Excel. You open the VBA editor with Alt+F11, write code, and it runs against the open workbook. Your macros are saved inside the .xlsm file. Anyone who opens the file with macros enabled can run them. Zero installation required.

Python

A general-purpose programming language. To use it with Excel you install Python on your machine, add a library like openpyxl or pandas, and write scripts that read and write .xlsx files from outside Excel. The script doesn't need Excel to be open. It can also pull data from the web, databases, APIs or any other source.

When VBA is the right first choice

Pick VBA if the problem lives entirely inside Excel. You want to click a button on a sheet and have it recalculate, reformat or export. You work in a corporate environment where installing new software is a two-week IT ticket. Your users aren't going to open a terminal. Your data lives in the same workbook you're automating.

  • Reformatting a report that always has the same shape
  • Button-click 'generate PDF' or 'send email' workflows that stay inside the file
  • Small, local automations your colleagues can actually use without extra setup
  • Anywhere IT policy makes installing Python a pain

When Python is the right first choice

Pick Python if the data comes from more than one place, or the transformations are more complex than a pivot. Python is faster at crunching large datasets, cleaner for merging multiple files, and far more pleasant for talking to APIs, databases and cloud services. Most of what's actually new about office automation — AI integrations, scheduled cloud jobs, Slack/Telegram notifications — lives in the Python ecosystem.

  • Weekly or monthly reports that combine CSVs, Excel files and database queries
  • Anything that pulls from a web API or scrapes a website
  • Data cleanup that would be a nightmare in Excel formulas
  • Pipelines that run on a schedule, with no human opening a file
  • Anything you want to grow into a real tool over time

What they both get wrong (if you only know one)

VBA-only people eventually hit the ceiling. Every time the task needs data from outside Excel, they'll build a fragile daisy chain of copy-paste steps. Python-only people often over-engineer small problems that a 10-line macro would solve in an afternoon. The pros use both — Python for the heavy data work, VBA for the user-facing bits inside the file your colleagues open every morning.

Pick the tool that matches the room your work lives in. If the room is one spreadsheet, that's VBA. If the room is the rest of the internet, that's Python.

A rough decision table

  • Automation runs inside one file → VBA
  • Automation pulls from multiple sources → Python
  • Users need to click a button → VBA
  • The job runs at 6 AM with no one watching → Python
  • You want to eventually use APIs, AI or cloud → Python
  • IT won't let you install anything → VBA
  • You want a skill that transfers to data work or software roles → Python

The takeaway

If you work in finance, audit or any role where spreadsheets are the final deliverable, learn VBA first — it unlocks real productivity in weeks, inside the files you already use. If you want to grow into data analysis, reporting pipelines or anything cloud-adjacent, learn Python first. The strongest Excel automators you'll meet know both, and switch between them without ceremony. Start with whichever one unblocks the task on your desk tomorrow.

Workshop

Build the real thing.

Articles help with the ideas. The live workshop walks you through building, backtesting and deploying a bot end-to-end.

Join the workshop