IT & Security

Writing Scripts and Spreadsheet Macros With AI

Describe one small, repetitive spreadsheet job in plain English and get a working Excel macro or Google Sheets script from an AI chat tool, then test it on a copy until it's right.

Reported results
Owner-reported: a founder expects a ChatGPT-written Excel macro for receipts to save "at least 30-60 minutes a month", after several rounds of fixing its errors with the AI
Difficulty
Intermediate
Cost to start
$0 with the free plans of ChatGPT, Claude or Gemini; Excel macros need desktop Excel (which you may already pay for), Google Sheets scripts are free with a Google account
Setup time
About 30–90 minutes for a first small macro, including several test-and-fix rounds on a copy of the file (estimate)
Type of AI
ChatYou paste or type into an AI assistant and use what it writes.
Last checked
Reported results: details
Owner-reported (Sara Vicente Barreto, Make Space for Growth, February 2026): she had ChatGPT write a VBA macro that spells out euro amounts as words in Portuguese for receipts, inside a monthly accounting Excel file she built over 10 years ago. She said it "would save at least 30-60 minutes a month cumulatively." It did not work the first or second time (function names, rounding problems, logic errors and a language bug), and she fixed each one by explaining the problem back to ChatGPT. That figure is her own expectation; the source doesn't report measured figures.Results are what the cited case study reports, not a promise. Yours will vary.
Where a person checks
Run every macro or script on a copy of the file first and check its results by hand against 5–10 test rows, including blanks, zero, very large numbers and odd values. Read the AI's plain-English list of what the code changes or deletes before you run it on the real file, and keep a backup.

Who it's for

Owners, office managers and bookkeepers at businesses of roughly 1–50 people who run part of the business in Excel or Google Sheets and repeat the same fiddly step every week or month, without being programmers.

Summary

Plenty of small businesses run their books, stock or schedules in a spreadsheet that works fine but still needs the same fiddly step every month. An AI chat tool can write the macro or script for that step if you describe it precisely, and you don’t need to be a programmer. Sara Vicente Barreto, founder of Make Space for Growth, described (February 2026) adding automation to a monthly accounting Excel file she built over 10 years ago. She started small: for receipts, she needed amounts like 180€ spelled out in Portuguese inside an English version of Excel, so she asked ChatGPT to build a custom VBA macro. “ChatGPT did the macro for me in a blink. And of course, it did not work the first time perfectly. Or the second.” Function names, rounding, logic and a language bug (“onehundreds”) all needed fixing, which she did by explaining each problem back to ChatGPT. She expected the macro to “save at least 30-60 minutes a month cumulatively.” Start with one small job, test on a copy, and only then touch the real file.

Try it today (45 minutes)

Pick one small step you repeat every week or month in Excel or Google Sheets (for example spelling out amounts, splitting a column, flagging duplicate rows or filling a category from a list). Save a copy of the file and work only in the copy. Open a free AI chat tool (ChatGPT, Claude or Gemini) and paste this prompt, filled in.

I need a [Excel VBA macro / Google Sheets Apps Script] for one small task. I am not a programmer, so explain simply.

My file: [what the file is for].
Sheet name: [name]. Columns: [e.g. A = Date, B = Amount, C = empty, for the result].
The task: [exactly what should happen, e.g. "write the amount in column B as words in column C, like 180 -> one hundred and eighty euros"].
Rules and odd cases: [e.g. blanks stay blank, round to 2 decimals, language/currency].

Please:
1. Write the code with a short comment on each part.
2. List in plain English exactly which cells it changes and whether it deletes anything.
3. Give me 6 test cases (including blank, zero and a very large value) with the result I should see.
4. Tell me step by step how to add it to my file and run it, and how to undo it.
5. Mark anything you had to assume as CHECK, and ask me if something is unclear.

Rules: Change only the cells listed. Never delete rows, sheets or data. Don't send email or touch other files.

Run it on the copy and check each test case by hand. If something is wrong, paste the exact error message or the wrong result back into the chat and say what you expected. Repeat until every test passes, then back up the real file before you add the macro to it.

Example output (illustrative, not a real customer result)

What the prompt above might return for a made-up business. Your output will depend on what you paste in.

Macro: AmountInWords for the Receipts sheet (Example Co.)
What it does: reads the amount in column B and writes it as words in column C
Before you run it: save a copy as .xlsm and test on the copy only
Test cases to check by hand:
  180 -> one hundred and eighty euros
  1,005 -> one thousand and five euros
  12.50 -> twelve euros and fifty cents
CHECK: amounts of 1,000,000 or more are not handled; the cell shows "TOO LARGE"
CHECK: amounts are rounded to 2 decimal places first (12.499 -> 12.50)
What it changes: only column C on the Receipts sheet; it deletes nothing
[NEED: the name of the sheet and column that hold your amounts]

Tools

  • ChatGPTFree option
    Free plan. Used in the case study to write and fix an Excel VBA macro.
  • Claude or Google GeminiFree option
    Free plans; the same prompt works. Paste back any error message word for word.
  • Microsoft Excel (desktop)
    VBA macros run in desktop Excel and need a macro-enabled file (.xlsm). Excel for the web can't run VBA macros.
  • Google Sheets with Apps ScriptFree option
    Free with a Google account (Extensions > Apps Script). Ask the AI for Apps Script instead of VBA if you work in Sheets.

Case study: Make Space for Growth (Sara Vicente Barreto)

Size: Founder-led organisation with a small team; headcount not stated

Source published Feb 6, 2026

In a February 2026 episode of her Try AI for Growth podcast, posted as an article on her own site, Sara Vicente Barreto describes adding automation to a monthly accounting Excel file she built over 10 years ago. The file supports monthly bank reconciliation, accounting classification, management reporting and exports for the accountant. She started with one small problem: for receipts, she needed amounts such as 180€ written out as words in Portuguese, inside an English version of Excel. She asked ChatGPT to build a custom VBA macro, without being a VBA expert. It did not work the first or second time: there were problems with function names, rounding and logic, and a language bug that produced words like "onehundreds". She fixed each by explaining where the problem came from, and says the back-and-forth of testing, failing and correcting is where most of the value came from. After closing the first month with the macro, she plans further small macros to flag recurring transactions and suggest classifications.

  • Her expectation for the first macro: "It would save at least 30-60 minutes a month cumulatively."
  • "ChatGPT did the macro for me in a blink. And of course, it did not work the first time perfectly. Or the second."
  • "With the help of AI, you don't need deep technical expertise to start automating."
  • "For now, I am just happy the process was closed faster and more smoothly."
  • No measured time or money figures were published

Read the source ↗

How we choose and check sources, and how to report a mistake: How we make and check recipes.

Common questions

Do I need to know how to code?

No. Sara Vicente Barreto says she is not a VBA expert and only needs to understand the code well enough to spot errors and corrections. You do need to understand the problem you are solving, what a mistake would break, and have time and patience to test.

Do I need a paid tool to try this?

The AI part costs $0 with the free plans of ChatGPT, Claude or Gemini. Excel macros need desktop Excel and a macro-enabled .xlsm file; Google Sheets scripts are free with a Google account.

What if the macro doesn't work the first time?

Expect that. Her macro failed the first two times because of function names, rounding, logic and a language bug. Paste the exact error or the wrong result back into the chat, explain what you expected, and test again on the copy.

What should a person check before using it on the real file?

Run it on a copy first and check the results by hand against 5 to 10 test rows, including blanks, zero, very large numbers and odd values. Read the AI's list of what the code changes or deletes, and keep a backup of the real file.

Related use cases

More recipes like this

Published 2026-11-04 · Last checked 2026-11-04 · Cost: Free to start

Did this work for you?

0/500 characters. Please leave out links.

We store your answer, your note if you write one (only we read it), and a salted hash of your IP address that changes daily (never the IP itself) to limit abuse. Your browser remembers your answer on this device. See our Privacy Policy.

Done-with-you

Need help setting this up?

Tell us a little about your business and what you'd like to get working. We'll point you to the right next step, whether that's a tool, a template, or someone who can set it up with you.

Coming soon Help requests open shortly. In the meantime, the 15-minute prompt above is the quickest way to get started, and you can subscribe below to hear when this goes live.

Get 3 practical AI recipes every week

Free, plain-language, no hype. New ways AI can save your team time, in your inbox every week. Unsubscribe anytime.