The Complete Excel Course with AI Integration
Excel macros and VBA for FP&A analysts
Before each variance review an FP&A analyst checks the actuals extract line by line for gaps and stray text, then formats the same pack again. The Complete Excel Course with AI Integration hands both jobs to macros and VBA on FormatWizard, an industry-standard project, and this page picks out its lessons: recorded macros on a button, the VBA editor and macro security, a last-row function, loops that flag faults, IsNumeric, colours, debugging 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 the formatting you give every variance report as a macro with relative references, so one shortcut or button formats whichever line you select.
- Keep a macro within reach of every model through the Personal Macro Workbook, the Developer tab and the Quick Access Toolbar.
- Save a model with its code as a macro-enabled .xlsm workbook, and know which trust settings decide whether a colleague's Excel will run it.
- Open the VBA editor with Alt+F11 and read the macros of an inherited model: modules, worksheet references, variables, a Sub and a Function.
- Find the last used row of an actuals extract that grows every month with a function of your own, GetLastUsedRow, so no check stops short or runs past the data.
- Loop through every line of an extract with For Next and If tests that flag a missing region or salesperson, the checks a cost centre or owner column needs, and gather each line's faults into one message.
- Catch an entry in an amount column that is not a number with IsNumeric, colour each fault with RGB, and clear the last run's flags before the next.
- Test what a macro reads with Debug.Print and the Immediate window, then run every check from one subroutine with an error handler.
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 pre-review guard for an actuals extract: VBA you write flags missing regions and salespeople, marks entries in number columns that are not numbers, colours each fault and writes the reason beside the row, the same test your cost centres, owners and amounts need before a variance review.
-
Project 09
FinanceGuard
The budget vs actual report finance teams send every month.
Where checked actuals go next: a budget vs actual model whose SUMIFS and variance formulas mislead or break when an amount column holds a word, which is why the macro runs before the model is refreshed.
-
Project 14
Agentic AI in Excel
AI finds and fixes the formula; you check it before it counts.
The assistant habits that keep a drafted macro honest: Copilot, ChatGPT and Claude set to one workbook, the PRO prompt pattern and a QA checklist, the routine you bring to any VBA an AI writes for your models.
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 if formulas are routine for you: the section assumes no programming, and its first run of lessons needs no code at all. New to Excel? Begin at Lesson 1, and you will reach the macros with relative and absolute references (Lesson 10) and IF (Lesson 29) already in hand. Recording macros already? Go to Lesson 141, where the VBA editor opens and the coding starts.
17 of 186 lessons · 1 h 16 min
14 VBA and macros in Excel: FormatWizard Macros before code: what a macro is and what FormatWizard becomes, a first recording named and run, relative references that make it work on any row, a button on the Developer tab and the Quick Access Toolbar, and the .xlsm format that keeps the code. For FP&A, the formatting of the monthly pack goes onto one click here.
- 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 Reading and writing code: the VBA editor and its workspace, macro security and trust settings, a first module that points at a worksheet, variables and data types, a Sub set against a Function, and GetLastUsedRow, built with Find, so code knows where an extract ends however many rows this month added.
- 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
- 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 a variance review needs on its actuals: old flags and fills cleared before each run, a For Next loop that flags a missing region, If and Else tests that gather each row's faults into one message, cells coloured with Interior.Color and RGB, and IsNumeric for an entry in a number column that is not a number.
- 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 Proving and finishing: Debug.Print and the Immediate window show what the code reads before it writes a flag, then one subroutine runs every check in order behind an error handler, with screen updating off while it works.
- 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.
Where can an FP&A analyst learn Excel macros and VBA for month-end work?
In The Complete Excel Course with AI Integration from Coding Liquids, on FormatWizard, an industry-standard project designed after talking with people from many different industries. Its macro section starts with recordings that put repetitive formatting on a button and finishes with VBA you write yourself: a function that finds where the data ends, loops that flag missing entries, IsNumeric tests on number columns, coloured faults, debugging and an error handler, all run from one subroutine. For an FP&A analyst that is the check an actuals extract needs before a variance review, and the formatting a monthly pack needs after it. This page picks out the 17 lessons, 1 hour 16 minutes of video. The lessons use a sales sheet with region, salesperson and amount columns; your cost centre, owner and actuals columns are checked the same way.
Where in the monthly reporting cycle do macros save an FP&A analyst the most time?
In three places, and The Complete Excel Course with AI Integration teaches the macro for each. Before the model: FormatWizard's VBA reads every row of an extract, flags missing entries and anything in a number column that is not a number, and colours each fault (Lesson 147 to Lesson 150), so the variance review starts from data you have checked. In the pack: a recorded macro with relative references formats whichever line you select from one shortcut or button (Lesson 138, Lesson 139). Between runs: a cleanup routine clears last month's flags and fills before the checks run again (Lesson 146). Exporting tabs to PDF, drafting emails and Goal Seek scenario loops are not lessons of their own, though the loop, the last-row function and the error handler you write are what such macros are built from.
Can a macro flag actuals lines with no cost centre or owner before the variance review?
Yes, and FormatWizard builds exactly that check, on columns of its own. In The Complete Excel Course with AI Integration a For Next loop visits every row from the first record to the last and writes Region missing beside any row whose region is blank, trimming first so a cell of spaces counts as empty (Lesson 147). Lesson 148 adds a second test for a missing salesperson and gathers both messages into one FlagText, split by a pipe, so a line missing two things says so in one place. Lesson 149 colours the empty cells a soft red as well. Read region as cost centre and salesperson as budget owner, change the column letters, and the same macro shows which actuals lines nobody can be asked about before they reach the review, with the reason written beside each.
Will a macro stop a note like TBC in an amount column from breaking the variance formulas?
Yes: IsNumeric finds it before the model does. In Lesson 150 of The Complete Excel Course with AI Integration the loop asks of every entry in a number column whether it can be treated as a number; a word, a note such as N/A or TBC, or a stray character answers no, so the cell and its flag turn light red with a message calling it invalid. That matters in FP&A because a subtraction on such a cell returns an error, and a SUMIFS total quietly leaves it out, so a variance can be wrong without looking wrong. Figures that are digits held as text are a separate fault, and the course fixes them elsewhere: a COUNT set against a COUNTA shows them up (Lesson 34, Lesson 35), and Power Query gives every column its true data type on each refresh (Lesson 158).
Can I put the formatting I apply to every variance report on one button?
Yes, without writing a line of code. The Complete Excel Course with AI Integration records it in Lesson 137: you name the macro, give it a shortcut and format a row with a negative amount, and the recording replays those steps whenever you run it. Lesson 138 records it again with relative references, so it formats whichever row you start from instead of the same one every time, which is what an over-budget line in a different place each month needs. Lesson 139 switches on the Developer tab and puts the macro on the Quick Access Toolbar as a button. Store a macro in the Personal Macro Workbook, which Lesson 137 introduces, and it is there whenever Excel opens on your computer, in every model and pack you work on. One caution from the lesson: Ctrl+Z cannot undo a macro.
I have inherited a forecast model full of macros: will this teach me to read and fix them?
Yes, and it teaches the reading first, which is where an inherited model starts. In The Complete Excel Course with AI Integration, Lesson 141 opens the VBA editor with Alt+F11 and maps it: the Project Explorer, modules as containers for code, the sheets and ThisWorkbook as objects, and the drop-down that moves between macros. Lesson 142 covers the macro security bar and trust settings, and fixes a real compile error. From Lesson 143 you meet the lines most macros begin with: a worksheet set to a variable, Option Explicit, declared variables with their data types, and the difference between a Sub that acts and a Function that hands back an answer. Debug.Print then shows what a routine reads as it runs (Lesson 151). UserForms and event macros are not covered; with the core in hand, the rest of an old model reads far more easily.
Can I send a macro-enabled model to budget holders without breaking it?
Yes, if it travels in the right format, and The Complete Excel Course with AI Integration covers both halves. Lesson 140 shows the trap first: save a workbook with code in the ordinary format and every macro is stripped out, so a model goes out as a macro-enabled .xlsm workbook, through Save As the first time. Lesson 142 explains what the person opening it sees: macros arrive disabled behind a yellow bar until they choose Enable Content, which they should do only for files they trust, so tell budget holders the file is yours before it lands. Once enabled, the macro runs the same way for them as for you (Lesson 136), and a button keeps it one click away (Lesson 139). A macro does not run in Excel on the web, so desktop Excel is where the model opens.
Can ChatGPT or Claude write the VBA for a planning model, and what should I check before running it?
They can draft it, and The Complete Excel Course with AI Integration trains you to be the person who signs it off. Lesson 148 has you write parts of the macro with Claude or ChatGPT and correct what comes back, after Lesson 88 has set out what each assistant can and cannot do. Then test the draft against what your own lessons taught: does the loop stop at the last used row, as GetLastUsedRow makes sure (Lesson 145); is a cell of spaces treated as empty (Lesson 147); what happens to an entry that is not a number (Lesson 150); and does one routine overwrite another's flags instead of appending to them (Lesson 152). Step through it with Debug.Print before it writes anything (Lesson 151), and run it on a copy, because Ctrl+Z cannot undo a macro on a live forecast.
With Power Query and dynamic arrays doing the data prep, where does VBA still earn its place in FP&A?
Inside the workbook, on demand, and in the models already built on it. The Complete Excel Course with AI Integration teaches every one of these tools, so you can give each its job. Power Query handles the clean-up and stacking of exports that return every month (Lesson 166), and dynamic arrays write the FinanceGuard model that recalculates as actuals land (Lesson 117). VBA does what neither does: it runs a set of your own rules across a whole sheet when you press a button, writes a reason beside each failing row, colours it and reports back (Lesson 152), and it is the language of the macros already sitting in the planning models you inherit. Power Automate Desktop drives Excel from outside, on Windows (Lesson 174), and its own closing lesson notes that a VBA macro usually runs faster over many rows (Lesson 185).
Will FormatWizard help me answer VBA questions in an FP&A interview or Excel test?
Yes, because you will have built every part you could be asked to explain. By the end of the macro section of The Complete Excel Course with AI Integration you can say why Option Explicit stops typo bugs (Lesson 144), how a function finds the last used row by searching upwards from the bottom (Lesson 145), how a For Next loop moves down a sheet (Lesson 147), why a flag message is emptied for each row (Lesson 148), what IsNumeric tests (Lesson 150) and why the finished macro turns screen updating off and carries an error handler (Lesson 152). The finished FormatWizard workbook is a real .xlsm file you can open and walk through. Completing the course earns a Certificate of Completion with a verification link an employer can check, and the macro behind it shows you can do the work.
Could I have a macro checking this month's actuals before the next close?
Yes: the whole section runs to 1 hour 16 minutes of video, and the parts arrive in the order you need them. By Lesson 140 of The Complete Excel Course with AI Integration your formatting is a recorded macro on a button, saved in a macro-enabled workbook. The checks follow one short lesson at a time, and Lesson 152 joins them into a single macro that clears the old flags, tests every row and reports when it is done. Build it first on the starter workbook and compare your code with the finished one, then change the sheet name and column letters to match your actuals extract and run it on a copy. Allow time beyond the video for typing the code and testing it on your own file, since that practice is what turns the lessons into a tool. Lifetime access keeps every lesson open for the next check you add.
Our planning team is split between Windows and Mac: can everyone follow the macro lessons?
Yes. VBA is part of desktop Excel on both, and the requirements of The Complete Excel Course with AI Integration name Windows only for Power Pivot and Power Automate, so the whole FormatWizard section is open to a Mac. The lessons are recorded on Windows, and the Developer tab lesson says so: on a Mac the screens look slightly different and the steps are a quick search away (Lesson 139). The keyboard shortcuts shown, such as Alt+F11 for the editor (Lesson 141) and Ctrl+G for the Immediate window (Lesson 151), are the Windows ones, and a Mac has its own. The code itself, the loops, the checks and the error handler, is the same on both, so the macro you build here runs on either in desktop Excel. Excel on the web is the one place it will not run.
Should a macro or Power Query combine the budget templates each department sends back?
Power Query, and The Complete Excel Course with AI Integration teaches it for exactly that kind of folder. From Folder in Lesson 166 stacks every file saved in a folder into one table, applies the same cleaning steps to each, and marks every row with the file it came from, which for returned budget templates means the department. A template that arrives late joins at the next refresh, and a month-per-column layout becomes a long table with Unpivot (Lesson 173). The templates need a shared layout, as a template sent out by FP&A normally gives. VBA then does the job it is best at: FormatWizard's checks run over the combined table and flag the lines a department left blank or filled with words (Lesson 152). A macro that opens each workbook in turn is not a lesson of its own; the folder query does that work without code.
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 FP&A analysts
- Lookups for FP&A analysts
- PivotTables for FP&A analysts
- Charts for FP&A analysts
- Dashboards for FP&A analysts
- Conditional formatting for FP&A analysts
- Data cleaning for FP&A analysts
- Data validation for FP&A analysts
- Excel tables for FP&A analysts
- Text functions for FP&A analysts
- Date functions for FP&A analysts
- Dynamic arrays for FP&A analysts
- Power Query for FP&A analysts
- Power Pivot and DAX for FP&A analysts
- Power Automate for FP&A analysts
- Copilot in Excel for FP&A analysts
- ChatGPT for Excel for FP&A analysts
- Claude in Excel for FP&A analysts