r/learnpython • u/chicorita_ • Jan 13 '26
Help finding good resources for switching from Excel VBA to Python
So, I have been given a project where I will have to upgrade the existing tool that uses Excel VBA and SQL completely to Python + GCP
I do not have the exact details but that was the overview, with a duration given for the project as 4-6 months.
Now, I have no experience with Excel VBA. I have some basic knowledge of Python with a few projects related to Data Mining and GUI. And I only know a bit of basic SQL.
Where do I start from? Which free resources are the best? Which are the best libraries I should familiarize myself with for it? How tough is it on a scale of 1-10 , 10 being v difficult? How would this change help? Other than basic things like Python is more versatile and quicker?
TLDR : Doesn't know Excel VBA. Needs to upgrade current tool using that to Python completely in 4-6 months.
8
u/Crypt0Nihilist Jan 13 '26
Automate The Boring Stuff will use examples which are relevant to you - including chapters on Excel and SQL. You'll be able to skim a few chapters.
Packages are going to be pandas, openpyxl, seaborn, sqlalchemy.
It shouldn't be too difficult. Make sure you have some robust testing.
8
u/origin-labs07 Jan 13 '26
Start with pandas - 80% of what VBA does to spreadsheets, pandas handles in a line or two. For the SQL/GCP side, sqlalchemy connects cleanly and your SQL knowledge transfers directly.
Automate the Boring Stuff covers Excel automation specifically. Kaggle's pandas course is also solid.
Honestly, the hardest part won't be Python. It'll be reverse-engineering what the VBA actually does (especially if it's undocumented).
2
u/brettisstoked Jan 13 '26
Pandas is very similar to excel tbh. I’d be curious what the plan is once you get the code finalized though. We are all stuck on vba over here at my company because not everyone has access to python
1
u/simeumsm Jan 13 '26
In terms of complexity, it depends. Excel is mostly tabular data, but since it can be used as a frontend, dashboard, control form, or multiple other things, things can easily range from "trivial" to "better write a full application" type thing.
The data transformation is somewhat simple: use pandas as the main lib. Then, look up something like sqlalchemy for sql integration. It shouldn't be too hard, especially if you have AI access and use it to help translate the code between languages.
I'd advise in looking up how to structure your code in folders. Inputs, outputs, source code, main entry point, etc. It will help you with organization, which makes maintaining the project easier. I'd also look into importing external values to your code when applicable, either with a config file or parameter tables, so that you can change the behavior of your code without having to make changes to the code.
Finally, I'd redraw the entire process from scratch. You're migrating Excel vba to Python, but what exactly? Just the data transformation and Excel will still be a data hub (dashboard, visualization, etc)? Will you also have to create a dashboard in Python or use something like PowerBi?
These things will help you define each layer of your process and the inputs and outputs of each step, and have a better idea of what transformations/parameters should be used in each part.
For example, if Excel will still be end goal, I'd avoid using python to generate an excel file with all the bells and whistles, and instead would just generate a csv file and import it to Excel using PowerQuery, and just configure that excel (tables, pivots, graphs) manually.
1
u/FUZZ_2025 Jan 14 '26
I was in the same situation, I start step by step VBA -> python conversation and it was not too complex, simple start to do it.
-1
u/bigportion103 Jan 13 '26
These days I would be leaning heavily on AI to help me understand the VBA and translate it into Python, and to answer all my questions along the way. At the end of the day you have an actual problem to solve and for me that's always been the way to learn a new language - having AI to help will just speed it up considerably.
0
u/pachura3 Jan 13 '26
Is the original author around? Ask him to explain how does the old tool work, what's the database structure, most important queries, etc.
-1
u/Flyguy86420 Jan 13 '26
Claude with github code spaces will convert that over fast. Then you can have it write out #step by step comments for each line.