Finance

Generating VBA macros for accounting workflows

AI is used to write VBA scripts and macros that automate repetitive accounting tasks such as journal-entry support work, balance-sheet reconciliations, workbook manipulation, data filtering, appending query outputs, and refreshing pivot tables.

Why the human is still essential here

The accountant still defines the workflow, explains requirements in plain English, validates outputs, and decides how the automation fits into financial close and reconciliation processes.

Need Help Implementing AI in Your Organization?

I help companies navigate AI adoption -- from strategy to production. Whether you are building your first LLM-powered feature or scaling an agentic system, I can help you get it right.

LLM Orchestration

Design and build LLM-powered products and agentic systems

AI Strategy

Go from idea to production with a clear implementation roadmap

Compliance & Safety

Build AI with human-in-the-loop in regulated environments

Related Prompts (2)

Latest community stories (1)

Personal Story
Reddit

How I use AI as a staff accountant

Hi all, I wanted to give my view on ai and its utility in my job as a staff accountant. My role is Excel-heavy, I enter many journal entries, and reconcile balance sheets for reference. Edit: I work for a private company.

The biggest use has been using ai to build TOOLS to automate workflows. I don’t drop in a workbook and ask it to do work for me (I think it’s starting to get closer to being able to accomplish this, but it uses expensive computation to get the job done). I use ai primarily to create Vba scripts / macros which are deterministic code to automate all sorts of work. I didn’t know how to code before using ChatGPT, so don’t be afraid of it. ChatGPT does all the technical writing while you describe what you need it to do in plain English. The secret here is that Vba is a powerful coding language that lives in all Microsoft applications. It’s not new, it’s not fancy, but the average person can now utilize its magic because of ai.


Some things Vba can do that blew my mind:


It can open, move, rename, or copy any file on your computer.


You can have a reconciliation open and have the macro open your latest downloaded excel workbook with a certain prefix (all my queries I download start with the same thing) filter for the data I need, and append the data to my reconciliation. Then automatically update pivot table ranges / refresh them. The macro can close the query workbook once it’s done with it too. There’s a secret to hidden-open the query workbooks so it saves on processing time since it doesn’t need to render images. Also, asking it to turn calculations off can speed things up but occasionally you might need calculations to occur before you can move on to the next step so keep that in mind.


Use the file name to roll forward reconciliations from month to month. I have the month and year in my filename, so when I copy a reconciliation to the next month, I open my workbook and dates are already rolled forward. This sounds simple but it’s helped me avoid having my recs sent back to me for silly fixes.


Error handling: most people who know about macros from a few years ago don’t want to touch them because they are prone to breaking. One link changes, one column shifts and your macro will either break or do the wrong thing. ChatGPT has good error handling for general coding failsafes. It will put in the script to include error messages that describe what is needed for the macro to start or where something failed and will cleanly exit the macro. The other thing is fixing macros is much easier. Copy the entire macro, paste into ChatGPT, and then ask it to update based off a different layout. The real game changer is asking it to write the macro dynamically. Instead of calling out stale columns or rows, use dynamic language to describe how to find things like the header row or what column it should look for. For example, instead of saying that headers are always in the first row, and copy column F into the workbook, ask it to find the row that starts with a certain header name that is consistent, and then look by column until it finds the header named “Amount” and then copy the data below that. If you can describe situations dynamically, you will drastically reduce the chance of your macros “breaking”.


Besides Vba, I’ve been diving into codex (now ChatGPT desktop app). Using it to build custom python scripts for more general computer workflows, as well as adhoc database files for one off research. Building custom databases and querying off of those are going to be way more consistent than just asking ChatGPT to look at data and give an answer. I’m still working on more “agentic” workflows, but honestly in the world of accounting powerful Vba macros gets you 85% of the way there. The idea is to use ai to build deterministic scripts to automate tasks.


Anyways, I hope this helps inspire some staff accountants out there looking to utilize ai in a meaningful way. Feel free to ask questions!

B
Broseidon132Staff accountant
Jul 19, 2026