The Complete Excel Course with AI Integration
Excel macros and VBA for accountants
Every period the same export needs the same checks: rows with a missing cost centre, amounts that are not numbers at all, last month's highlights still on the sheet. The Complete Excel Course with AI Integration turns those checks into one macro on FormatWizard, an industry-standard project, and this page picks out its lessons in the order they build: a recorded macro, the VBA editor and its trust settings, a last-row function, the validation loop and an error handler.
Taught by Sagnik Bhattacharya and Virginia Thorn
What you will be able to do
At work, you will be able to:
- Record a macro that formats an exception row, with relative references so it works from whichever row you select, and run it from a button or the Quick Access Toolbar.
- Keep macros in the macro-enabled .xlsm format, and enable content in a workbook from someone else only once you trust where it came from.
- Write a GetLastUsedRow function that finds where this period's export ends, so every routine fits a file of any length.
- Loop through every row of a ledger-style export with For Next, flagging missing fields with If and Else tests and one message per row in a flag column.
- Catch amounts and unit figures that are not numbers with IsNumeric, and colour each faulty cell with Interior.Color and an RGB value.
- Clear the previous run's flags and fills before each new check, so an exception report never mixes this month's faults with last month's.
- Use Debug.Print and the Immediate window to see exactly which cells the code reads before it writes a single flag.
- Join every check into one master macro with an error handler that names a fault instead of crashing, ready to run in one click at month end.
Projects
What you will build.
The course has 14 industry-standard projects. These three matter most here.
-
Project 11
FormatWizard
One click that checks a whole sheet for you.
A month-end exception report in miniature: a flag column that names each missing field or invalid amount in an export of thousands of rows, the faulty cells coloured, old flags cleared before every run, and an error handler that reports instead of crashing.
-
Project 14
Agentic AI in Excel
AI finds and fixes the formula; you check it before it counts.
The checking habit to bring to any macro an assistant drafts: formula columns written by Copilot and ChatGPT and tested a row at a time, and a short checklist for every result, the routine Lesson 148 then turns on VBA when you draft parts of the code with ChatGPT or Claude.
-
Project 12
SalesFusion
A sales report that refreshes itself from a folder of files.
The answer to the import and consolidation jobs a macro is often asked to do: a folder of period files stacked and cleaned at every refresh with no code at all, leaving VBA to the checks and formatting it does best.
Lessons
The lessons that matter, in course order.
The Complete Excel Course with AI Integration has 186 lessons. This page picks out 17 of them, 1 h 16 min of video. Each lesson keeps its number in the course.
Where to start
Lesson 136 Excel macros and VBA for beginners
Start at Lesson 136: FormatWizard begins with a recording and reaches code a step at a time, so no programming is assumed. Already recording macros at month end? Go to Lesson 143, where the code you write yourself begins. New to Excel? Start at Lesson 1 and come here once tables and IF formulas feel routine. If the job you want automated is an import that comes back every period, add SalesFusion's Power Query lessons from Lesson 153 as well.
17 of 186 lessons · 1 h 16 min
14 VBA and macros in Excel: FormatWizard Macros before code: what a macro is, a first recording that formats a row holding a negative amount, then relative references so the same keystroke formats whichever row you start from, a button on the Developer tab and the Quick Access Toolbar, and the .xlsm format that keeps the macros. The sales sheet stands in for any export with exception rows to mark.
- 136 Start here Excel macros and VBA for beginners What macros are, the FormatWizard project 3 min
- 137 Record your first Excel macro Name, run and use absolute references 6 min
- 138 Relative references in Excel macros Make recorded macros dynamic 4 min
- 139 Developer Tab in Excel Run macros from a button and the quick access toolbar 4 min
- 140 Save macros in Excel Macro-enabled workbooks and the XLSM file format 3 min
14 VBA and macros in Excel: FormatWizard The VBA editor, its modules and its code window, then macro security: content enabled only for workbooks you trust, which matters for every file that arrives from a client or another team, and a compile error found and fixed.
- 141 The VBA Editor in Excel Open it with Alt+F11 and learn the workspace 4 min
- 142 Working in the VBA editor Macro security, trust settings, switching to Excel 6 min
14 VBA and macros in Excel: FormatWizard First code that points at a named worksheet, variables declared under Option Explicit, the difference between a Sub and a Function, and GetLastUsedRow, which searches up from the bottom for the last row of data, so one macro fits a short month and a long one.
- 143 Your first VBA code Modules, worksheets, rows, columns and formatting 4 min
- 144 VBA variables and data types Sub vs function for Excel beginners 6 min
- 145 VBA functions in Excel Build GetLastUsedRow with find and exit function 5 min
14 VBA and macros in Excel: FormatWizard The checks of an exception report, one to a lesson: old flags and fills cleared, a loop that flags every missing region, a second test for a missing salesperson gathered into one message per row, the faulty cells coloured light red, and IsNumeric catching unit figures that are not numbers. On a ledger the same tests look for a missing cost centre, a missing approver and an amount that is a word or a note where a figure belongs.
- 146 Clear old flags with VBA Reset messages and fill colours with if statements 5 min
- 147 For Next loop in VBA Flag missing region values in Excel 4 min
- 148 VBA If Else and loops Check missing sales data and build a FlagText message 5 min
- 149 Highlight cells with VBA Interior.Color and RGB for missing data 5 min
- 150 IsNumeric in VBA Validate unit price and amount data types in Excel 7 min
14 VBA and macros in Excel: FormatWizard Debug.Print and the Immediate window show which cells the code reads before it writes, then one master macro runs every check with screen updating off and an error handler that names the fault: the one-click audit to run before figures are reported.
- 151 Debugging VBA for beginners Debug.Print and the Immediate window 5 min
- 152 Complete Excel validation macro One VBA subroutine with an error handler 3 min
Instructors
Who teaches it.
Instructor, Excel with AI
Virginia Thorn
Emmy Award winner. Teaches Excel with AI at Coding Liquids.
Questions
Asked before starting.
What can accountants automate with Excel macros and VBA?
The checks and formatting that come round every period, and The Complete Excel Course with AI Integration from Coding Liquids teaches both on FormatWizard, an industry-standard project designed after talking with people from many different industries. A recorded macro marks an exception row in one keystroke and runs from a button. Written VBA then reads every row of an export, flags a missing field or an amount that is not a number in a flag column, colours each faulty cell, clears the previous run's marks first and reports any fault through an error handler, all from one master macro. This page picks out the 17 lessons that build it, 1 hour 16 minutes in all. The lessons use a sales export of thousands of rows; a ledger, a sub-ledger listing or a file of expense claims is checked the same way, column for column.
Which month-end checks can a VBA macro run on a ledger export?
Three checks and a clean-up, joined into one run, and The Complete Excel Course with AI Integration has you write each of them. Lesson 146 clears the flag column's old messages and fills, so last period's marks never mix with this period's. Lesson 147 loops through every row and writes Region missing wherever the region is blank, using Trim so a cell holding only spaces still counts as empty. Lesson 148 adds a second test for a missing salesperson and gathers both results into one message per row, separated by a pipe. Lesson 150 flags a unit figure that is not a number. On a ledger the same tests look for a blank cost centre, a missing approver and an amount that is not a number, and Lesson 152 runs the lot in a single click.
Can a recorded macro format the exception rows in a report?
Yes, and that is where The Complete Excel Course with AI Integration begins. In Lesson 137 you record a macro that makes a row holding a negative amount bold, italic and highlighted, name it, give it a shortcut and run it; recorded with absolute references, it always formats that same row. Lesson 138 records it again with relative references, so it formats whichever row you start from, one keystroke per exception. Lesson 142 then shows the recorder's limit: the recorded code formats the row without checking that the amount is negative, which is why the later lessons write the test in VBA. And if all you want is negative figures in red brackets, a custom number format does it with no code at all (Lesson 119).
My exports are a different length every month: will the macro cope?
Yes, because the first function you write finds the end of the data for itself. Lesson 145 of The Complete Excel Course with AI Integration builds GetLastUsedRow: it returns zero for an empty sheet, guarded by COUNTA, and otherwise searches upwards from the bottom with Find for the last row holding anything. On the course's file it reports row 5071, then 5072 once a row is pasted in, with no change to the code. Every later routine asks it where to stop, and Lesson 146 makes it Public so any module can call it, while a check that finds nothing but a header row stops with a message instead of running on empty. A short month and a long one, a quiet quarter and the year end: the same macro fits each file.
Can VBA catch amounts that are stored as text?
VBA catches every amount that is not a number at all, and The Complete Excel Course with AI Integration hands you two more tools for digits that only look like numbers. In Lesson 150 a loop asks IsNumeric of every row whether the unit figure can be treated as a number; where it cannot, because someone typed a word, a note such as N/A or a stray character, the cell and its flag turn light red and the flag reads units invalid, not missing, since the cell is wrong and not empty. Digits that a ledger system exported as text still pass that test, so you meet them twice elsewhere: Lesson 34 sets COUNT beside COUNTA, which shows a column holding fewer true numbers than entries before a SUM comes out short, and Lesson 158 sets each column's data type in Power Query, a fix that repeats on every refresh.
Will ChatGPT draft the code for my month-end checks, and should I trust it?
It can draft it, and The Complete Excel Course with AI Integration makes you the person who decides whether the draft is right. After the two-check loop of Lesson 148, the lesson sets you to write parts of the code with ChatGPT or Claude and then correct what comes back. The rest of the section supplies what the correcting needs: you know where a loop should stop because you built GetLastUsedRow, you know a blank must be trimmed before it is tested, and you know two routines writing to one cell must append. The AI lessons add the method: precise prompts, and results checked a row at a time before they count (Lesson 95). A draft you cannot read is a risk on client figures; a draft you can correct is a head start, and this section builds that difference.
Is it safe to run macros in workbooks from clients or other teams?
Yes, once you trust where the file came from, and The Complete Excel Course with AI Integration teaches the settings that keep that decision in your hands. A workbook with code opens with its macros disabled and a yellow bar offering Enable Content; Lesson 142 enables it for the course's own file and gives the rule to follow: only for files you trust. Before trusting one, you can see what it holds, since Lesson 141 tours the Project Explorer, where each module opens to show its code. Lesson 140 covers the format side: macros are kept in the macro-enabled .xlsm format, while saving as .xlsx strips every one of them out. For an accountant handed a colleague's month-end workbook, that means knowing what will run before it touches the figures.
Can a macro report what went wrong instead of just stopping?
Yes: the master macro of The Complete Excel Course with AI Integration has an error handler, which is what makes it safe to run under deadline. Lesson 152 reads RunFullValidation: On Error GoTo sends any fault to a handler that switches screen updating back on and shows the error's own description, so you learn what failed instead of staring at a frozen screen. Screen updating is off while the checks run, which speeds up a long sheet, and the lesson fixes a quiet fault of its own: two routines writing to the same flag cell must append after a pipe, or the second wipes out the first. A misspelt call raises a compile error that is fixed on screen. The result is one click that runs the clean-up and every check in order, then says it has finished.
How can I be sure a macro read the right cells before it wrote anything?
Watch it read first, which is exactly what Lesson 151 of The Complete Excel Course with AI Integration teaches. Debug.Print writes to the Immediate window, not to the sheet and not in a pop-up, so a routine can print each row number beside the value it found in column A while nothing on the sheet changes. The lesson checks the first five rows that way before any flag is written, because a macro reading the wrong column makes the same mistake on every row of an export of thousands. Option Explicit, set from Lesson 144, closes the other common gap: a misspelt variable stops the code instead of quietly reading nothing. For an accountant this is the macro version of tick and bump: proof of what the code saw before you rely on what it says.
Can a macro consolidate a month of files into one sheet?
The Complete Excel Course with AI Integration hands that job to Power Query, which does it without code and keeps on doing it. In SalesFusion, Lesson 166 combines every file in a folder into one table, each row marked with the file it came from, and the next file saved there joins at the following refresh; the cleaning set on one file applies to all of them. The VBA section stays with what macros do best inside a workbook: formatting, checking and flagging the data once it is together. Macros that open files one by one, save PDF copies or send emails are not among its lessons. Together the two tools cover the month: Power Query to gather and clean, a FormatWizard macro to check and mark the result.
With Power Query and Power Automate around, is VBA still worth an accountant's time?
Yes, for the work the other two do not reach, and The Complete Excel Course with AI Integration teaches all three so each lands where it fits. Power Query takes the exports that return every period and cleans and combines them at a refresh (Lesson 153 onwards). Power Automate Desktop runs routines that drive Excel from outside, reading a sheet and writing results back, on Windows (Lesson 174 onwards). VBA works inside the workbook: formatting rows, checking every line against your rules and writing what it finds beside them, which is the FormatWizard build. A macro workbook handed over by a predecessor also needs someone who can read it. Office Scripts, the browser version's alternative, are not taught; desktop Excel on Windows or Mac runs everything on this page.
I am good with formulas but have never coded: can I still write VBA?
Yes, and an accountant's way of reviewing a sheet is already half of it. A review run by eye, going down every line, testing it and noting the fault, is the loop that The Complete Excel Course with AI Integration teaches you to write: For Next moves down the rows (Lesson 147), If and Else test each one (Lesson 148), and a flag column records the result. The section starts with no code at all, recording a macro and running it from a button, and the code then arrives one idea per lesson, from a first line that names the worksheet (Lesson 143) to variables, a Sub and a Function (Lesson 144). Each lesson builds on the same workbook. With the instructor support plan, a question about your own code goes to the instructor in writing.
Can I point FormatWizard's checks at the columns of my own ledger?
Yes, and the code is written so the change is small. The checks in The Complete Excel Course with AI Integration name their columns plainly, region in column B, salesperson in C, unit figures in F and flags in H, and the colour in Lesson 149 is a single RGB value, so moving a check means changing a letter, the way the lesson itself copies the region line and turns B into C for the salesperson. Point B at your cost centre, C at your approver and F at your amount, and the same loop flags your ledger. GetLastUsedRow already copes with any length of file. The finished macro-enabled workbook comes with the course to compare against, and the Personal Macro Workbook from Lesson 137 keeps a macro available whenever Excel opens on your computer.
How soon can a macro save me time at month end?
About 1 hour 16 minutes for the full build, and a working macro long before that. The Complete Excel Course with AI Integration has you record your first one in Lesson 137, and once Lesson 138 makes it relative, one keystroke formats any exception row you select: that alone can take over a formatting routine at the next close. The validation then grows a check per lesson, from the clean-up of old flags in Lesson 146 to the master macro of Lesson 152, which you can run before any figure leaves your desk. The lessons are short enough to take several at a sitting. Lifetime access keeps them open for the next routine worth automating, and completing the course earns a Certificate of Completion with a verification link an employer can check.
Excel with AI
See the whole course.
The Complete Excel Course with AI Integration: 16 hours of video in 186 lessons, built around 14 industry-standard projects, with lifetime access, a Certificate of Completion and a 14-day money-back guarantee.
The same course
For another job, skill, goal, level, topic or comparison.
The course for this job
The course for this skill
More skills for this job
- Excel formulas for accountants
- Lookups for accountants
- PivotTables for accountants
- Charts for accountants
- Dashboards for accountants
- Conditional formatting for accountants
- Data cleaning for accountants
- Data validation for accountants
- Excel tables for accountants
- Text functions for accountants
- Date functions for accountants
- Dynamic arrays for accountants
- Power Query for accountants
- Power Pivot and DAX for accountants
- Power Automate for accountants
- Copilot for accountants
- ChatGPT for accountants
- Claude in Excel for accountants