The Complete Excel Course with AI Integration

Excel macros and VBA for management accountants

Every month a management accountant formats the same schedules and scans the same exports for gaps before a report can go out. The Complete Excel Course with AI Integration hands both routines to macros and VBA on FormatWizard, an industry-standard project, and this page picks out the lessons in the order you need them: recording the formatting, reading the code, finding the last row, flagging gaps and bad amounts, and one master check with an error handler.

Taught by Sagnik Bhattacharya and Virginia Thorn

The Complete Excel Course with AI Integration: Sagnik Bhattacharya and Virginia Thorn

What you will be able to do

At work, you will be able to:

  • Record a macro that formats a schedule the same way every month, run it from a shortcut or a Quick Access Toolbar button, and keep it in a macro-enabled workbook.
  • Switch a recorded macro to relative references, so one keystroke formats whichever adverse line the cursor sits on.
  • Read and edit recorded code in the VBA editor, with modules organised, Option Explicit set and the trust settings for macros understood.
  • Find the last used row of any export with a reusable VBA function, so a check covers every line however long the month's file runs.
  • Loop through every line of an export and flag missing cost centres or budget holders in a Flag column, with each gap coloured a soft red.
  • Flag any entry in an amount column that is not a number, such as a word or a stray character, before the figures feed a report.
  • Clear last month's flags and run every check from one master macro with an error handler, then trace a fault with Debug.Print and the Immediate window.

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.

    Built on several thousand rows of sales data, it hands a management accountant the full pattern of an export review: recorded formatting, a last-row function, loops that mark gaps in a Flag column, colour on the cells at fault and a master routine with an error handler.

  • Project 12

    SalesFusion

    A sales report that refreshes itself from a folder of files.

    A Power Query modelling project on messy sales exports, it is the better home for clean-up a macro would otherwise loop through: trimmed codes, true number types and merged lookups held as query steps, leaving VBA the formatting and checking that happen inside the finished workbook.

  • Project 13

    AutoFlow

    The weekly report routine, run by a flow instead of by you.

    A Power Automate Desktop project that needs Windows, it carries the same idea outside the workbook: a flow launches Excel, reads the worksheet, loops through rows and writes results back, so you can see where a macro's reach ends and a flow's begins.

Tap or pinch to zoom in, drag to move around. Click or scroll to zoom in, drag to move around.

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 whatever your Excel level: the section assumes no coding, begins with the macro recorder and moves into VBA one idea per lesson. New to Excel altogether? Begin at Lesson 1; the FormatWizard sheet reads more easily once tables, sorting and filtering are familiar. Recorded macros before? Go to Lesson 141, where the editor opens and the code begins, or to Lesson 146 if you already write simple VBA and want the checking routines themselves.

17 of 186 lessons · 1 h 16 min

14 VBA and macros in Excel: FormatWizard 5 of 17 lessons · 19 min Recorded macros for the routine formatting of a pack: the FormatWizard sheet and its Flag column, a macro that formats a row holding a negative amount, recorded with absolute and then relative references, run from the Developer tab, a shortcut and a Quick Access Toolbar button, and saved as a macro-enabled .xlsm file so the code travels with the data.
  1. 136 Start here Excel macros and VBA for beginners What macros are, the FormatWizard project 3 min
  2. 137 Record your first Excel macro Name, run and use absolute references 6 min
  3. 138 Relative references in Excel macros Make recorded macros dynamic 4 min
  4. 139 Developer Tab in Excel Run macros from a button and the quick access toolbar 4 min
  5. 140 Save macros in Excel Macro-enabled workbooks and the XLSM file format 3 min
14 VBA and macros in Excel: FormatWizard 5 of 17 lessons · 23 min Into the code: the VBA editor opened with Alt+F11, macro security and trust settings, the first line that points code at its sheet, variables declared under Option Explicit, Sub set against Function, and GetLastUsedRow, a function that finds the end of the data however far an export runs.
  1. 141 The VBA Editor in Excel Open it with Alt+F11 and learn the workspace 4 min
  2. 142 Working in the VBA editor Macro security, trust settings, switching to Excel 6 min
  3. 143 Your first VBA code Modules, worksheets, rows, columns and formatting 4 min
  4. 144 VBA variables and data types Sub vs function for Excel beginners 6 min
  5. 145 VBA functions in Excel Build GetLastUsedRow with find and exit function 5 min
14 VBA and macros in Excel: FormatWizard 5 of 17 lessons · 27 min The checks a management accountant wants before an export feeds a report: old flags and fills cleared, a For Next loop that flags every missing region, a second test for missing salespeople joined into one message per row, RGB fills that mark the gaps in light red, and IsNumeric flagging any per-unit figure that is not a number. On your own file, region and salesperson become cost centre and budget holder.
  1. 146 Clear old flags with VBA Reset messages and fill colours with if statements 5 min
  2. 147 For Next loop in VBA Flag missing region values in Excel 4 min
  3. 148 VBA If Else and loops Check missing sales data and build a FlagText message 5 min
  4. 149 Highlight cells with VBA Interior.Color and RGB for missing data 5 min
  5. 150 IsNumeric in VBA Validate unit price and amount data types in Excel 7 min
14 VBA and macros in Excel: FormatWizard 2 of 17 lessons · 8 min Proof before trust: Debug.Print and the Immediate window to see what the code reads before it writes, then RunFullValidation, one master macro that runs every check in order with screen updating paused and an error handler that reports a fault instead of crashing.
  1. 151 Debugging VBA for beginners Debug.Print and the Immediate window 5 min
  2. 152 Complete Excel validation macro One VBA subroutine with an error handler 3 min

Instructors

Who teaches it.

Virginia Thorn smiling at the camera, dark hair tied back, wearing a navy top.

Instructor, Excel with AI

Virginia Thorn

Emmy Award winner. Teaches Excel with AI at Coding Liquids.

Questions

Asked before starting.

Which of a management accountant's monthly routines are worth automating with Excel macros and VBA, and where can I learn to do it?

The ones that repeat without judgement, and The Complete Excel Course with AI Integration from Coding Liquids teaches you to automate them on FormatWizard, an industry-standard project designed after talking with people from many different industries. Two routines lead the list. Formatting: the same schedules styled the same way every month, which a recorded macro replays from a shortcut or a button (Lesson 137 to Lesson 139). Checking: an export scanned for blank codes, missing owners and amounts that are not numbers before it feeds the variance report, which VBA does row by row, flagging and colouring each fault (Lesson 147 to Lesson 150). Lesson 152 then joins every check into one routine with an error handler. The 17 lessons on this page take 1 hour 16 minutes and start from the recorder, so your first macro runs on your own pack long before the section ends.

Adverse variances in our pack are made bold and highlighted by hand: can a recorded macro do that?

Yes, and that is the very first macro The Complete Excel Course with AI Integration records. In Lesson 137 a row holding a negative amount is made bold, italic and highlighted while the recorder runs, and the result replays on Ctrl+Q. Recorded that way the macro always formats the same row, so Lesson 138 records it again with relative references: select any line, press the shortcut, and that line is formatted, one keystroke per adverse variance. Lesson 139 adds the Developer tab and a Quick Access Toolbar button, and Lesson 140 saves the file as .xlsm so the macro survives. Lesson 142 then shows the limit: recorded code formats wherever it is pointed and never checks whether the figure is negative. That judgement needs VBA's If, taught from Lesson 146, or a custom number format that shows variances with colours and signs by itself, as FinanceGuard does in Lesson 119.

I already record macros: what does writing VBA add for someone who builds management reports?

Decisions. A recording replays clicks on the cells it was made on; VBA reads each line of the data and acts on what it finds. The Complete Excel Course with AI Integration builds that up one idea at a time: Lesson 143 points code at a named sheet through a variable, Lesson 144 declares variables under Option Explicit, which stops typos becoming silent bugs, and sets a Sub beside a Function, and Lesson 145 writes GetLastUsedRow, a function any later macro can reuse. Then comes the logic: a For Next loop visits every row (Lesson 147), If and Else test what each row holds (Lesson 148), and the code writes a message and a colour wherever something is wrong. For management reports that is the step from a macro that styles a schedule to one that reviews the export behind it, every row, every month, the same way, with an error handler to report a fault instead of crashing.

Our ledger export is a different length every month: will the macro reach every row?

Yes, because the macro finds the last row itself instead of trusting a fixed range. The Complete Excel Course with AI Integration builds GetLastUsedRow in Lesson 145: it first counts whether the sheet holds anything at all, returning zero for an empty sheet, then uses Find to search upwards from the bottom for the last cell with content and hands that row number back. Paste one more row of data, run it again, and the answer moves down by one. Every checking loop of the section runs from row 2 to that last row, so a long month and a short month are covered alike, and Lesson 146 adds a guard that stops with a warning when a sheet holds only headers. For an export that grows with the business, that one function is what keeps the check honest: nothing at the bottom is skipped, and nothing below the data is flagged by mistake.

Before the cost report is built, can a macro mark lines with no cost centre, no budget holder or an amount that is not a number?

Yes, and The Complete Excel Course with AI Integration builds exactly that kind of check on its sales sheet, where region and salesperson stand in for your cost centre and budget holder. Lesson 147 loops down the data and writes Region missing in the Flag column wherever the region cell is empty, trimming first so a cell of spaces counts as empty. Lesson 148 adds the second test in the same loop and builds one message per row, the faults joined by a pipe, and Lesson 149 colours each empty cell a soft red with RGB, so the gaps show in two layers, a word in the Flag column and colour on the cell itself. Lesson 150 uses IsNumeric to flag any entry in the number column that is not a number, a word, a note such as N/A or a stray character, colouring the cell and its flag. Change the column letters, and the same routine reviews your cost listing.

Will last month's flags and colours get mixed up with this month's results?

They are cleared before every run, by a routine The Complete Excel Course with AI Integration builds for that purpose in Lesson 146. It finds the last row, empties the Flag column's messages from row 2 down and removes every fill colour in that range, so each check starts from a clean column, and a guard stops it with a warning when the sheet holds nothing but headers. The lesson also makes GetLastUsedRow public, so routines in other modules can call it. In Lesson 152 the master macro runs this clean-up before any check, and one detail there matters to an accountant: the per-unit check is changed to add its message after a pipe instead of overwriting the cell, because two checks writing to one flag would otherwise erase each other. The result is a Flag column that always describes this month's file and only this month's, with no stale warning left to mislead a reviewer.

When the close is busy, can the whole review run at once, and will a failed step leave the pack in a mess?

One button runs it all, and a fault produces a message instead of a crash. The Complete Excel Course with AI Integration assembles RunFullValidation in Lesson 152: it clears the old flags, runs the missing-data checks, then the number check, in that order, with screen updating switched off so thousands of rows are processed without the screen redrawing at every step. If anything fails, the error handler turns screen updating back on and shows the error's description, so you learn what went wrong and the workbook is left usable. A success message confirms a clean run. Put the macro on the Quick Access Toolbar as in Lesson 139 and the whole review of an export is one click at the start of the close. The lesson also fixes a compile error from a misspelt call, the kind of slip you will make yourself, so you see how Excel points at it and how little it takes to put right.

Ctrl+Z cannot undo a macro: how do I test one safely before it touches the live management pack?

By watching what the code reads before you let it write, which The Complete Excel Course with AI Integration teaches as a habit, not an afterthought. Lesson 137 makes the warning plain: a macro's changes cannot be undone with Ctrl+Z, so new code belongs on a copy of the pack first. Lesson 151 gives you Debug.Print and the Immediate window, opened with Ctrl+G: the code prints each row number with the value it found there, nothing is written to the sheet and no pop-up interrupts, so you can confirm the right cells are read in the right order before flags spread over hundreds of rows. Option Explicit (Lesson 144) catches a mistyped variable before the code runs, and compile errors are met and fixed in Lesson 142 and Lesson 150. Together they make a macro something you can sign off, not something you merely hope works.

If Claude or ChatGPT writes part of my macro, how do I know it is right before it runs on our figures?

You read it the way The Complete Excel Course with AI Integration teaches you to read every macro: line by line, knowing what each line does. In Lesson 148 learners write parts of the two-check macro with Claude or ChatGPT, each in its own window, and then correct what comes back, which is the sound way to use them: the assistant drafts, you decide. The section gives you what that judgement needs. Lesson 145 walks through a pasted function line by line; Lesson 149 shows how one unchanged column letter makes the wrong column light up, a slip an assistant makes too; Debug.Print (Lesson 151) shows what the code reads before it writes anything. For figures that reach a management pack, a draft you can read is useful and a draft you cannot read is a risk, and the course leaves you able to tell which one you are holding.

Our IT team is wary of macros: what does the course teach about opening and saving them safely?

Exactly the settings an IT team will ask about, so you can answer its questions. The Complete Excel Course with AI Integration meets macro security in Lesson 142: a workbook with code opens with its macros disabled under a yellow bar, and Enable Content is clicked only for files you trust, a rule the lesson states plainly. Lesson 140 explains the file types: a standard .xlsx strips every macro out when saved, while the macro-enabled .xlsm keeps the code beside the data, and the first save of a file with code needs Save As. Lesson 137 covers where a macro lives, in the workbook itself or in the Personal Macro Workbook that makes it available whenever Excel opens on your computer. For a management accountant that means macros kept in known files and opened deliberately, with nothing in the pack that a reviewer cannot find in the editor (Lesson 141).

Where does a macro fit beside Power Query and Power Automate in the month end?

Each does a different part of the work, and The Complete Excel Course with AI Integration teaches all three, so every routine can go to the right tool. Power Query, in the SalesFusion lessons from Lesson 153, reshapes data on its way in: trimmed codes, true number types and merged lookups held as steps that run again on every export. VBA acts on the workbook once the data is there: formatting the schedules, flagging rows that fail a check, colouring the cells at fault and reporting the result, which is FormatWizard's work in this section. Power Automate Desktop, from Lesson 174, runs a routine from outside Excel, opening the file, reading rows, looping and writing back, and those lessons need Windows. A well-run month end uses each where it is strongest: the query cleans the export, the macro reviews and formats the pack, and a flow takes over the steps that happen outside the workbook.

FormatWizard checks a sales sheet: how does that carry over to our cost centre reports?

Directly, because a macro cares about columns and rows, not about what they record. Built on a sales sheet with dates, regions, salespeople, units, a per-unit figure and an amount, FormatWizard in The Complete Excel Course with AI Integration gives a management accountant a template for any listing that needs reviewing: the last-row function, the loop, the tests and the Flag column work the same whatever the rows hold. To run it on a cost centre listing, point the code at your sheet's name (Lesson 143), change the column letters each check reads, and reword the messages, so Region missing becomes Cost centre missing. Lesson 149 shows why the letters matter, since one left unchanged lights up the wrong column. The practice files include the starter workbook and the finished FormatWizard .xlsm, so you can compare every module with a working answer before adapting it to your own reports.

I have never written code and I use Excel on a Mac: can I still follow these lessons?

You can, on both counts. The Complete Excel Course with AI Integration assumes no coding at all here: the section opens with the macro recorder, which writes VBA for you while you work, and only then opens the editor to read what was written (Lesson 141), before your first typed line in Lesson 143. Each lesson adds one idea, a variable, a function, a loop, a test, and the longer routines are pasted and read line by line rather than typed from memory. The course's requirements set no Windows condition for this section. The lessons are recorded on Windows, so the shortcuts shown, Alt+F11 for the editor among them, are Windows ones, and Lesson 139 notes that a Mac's screens look slightly different there, with the steps a quick search away. Macros make a good first taste of code for a management accountant, because every result lands on a sheet you can check.

The close starts next week: how far into the section must I get before a macro is checking our export?

About halfway, and the formatting macro arrives sooner still. In The Complete Excel Course with AI Integration the recorded macro that styles a row is working by Lesson 137, with a button for it by Lesson 139: that alone can take the formatting of the pack off your hands this month. The checking starts at Lesson 147, where a loop flags every missing value in a column, and by Lesson 150 the routine tests two columns for gaps and a third for entries that are not numbers. Lesson 152 completes it as one master macro. All of it fits in 1 hour 16 minutes, so an evening or two of practice on the FormatWizard files, then some time adapting the column letters to your own export, puts a working check in place before the close begins. Lifetime access keeps the section open for the next routine you want to hand over.

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.