The Complete Excel Course with AI Integration
Excel macros and VBA for inventory controllers
Scanning a stock sheet for blank codes, notes typed into the count column and lines that need attention is the kind of check a macro does in one click. The Complete Excel Course with AI Integration teaches it on FormatWizard, an industry-standard project: a recorded macro first, then VBA that loops through every row, flags and colours each fault and reports back. This page picks out the whole macros and VBA section and ties each lesson to a stock controller's sheets.
Taught by Sagnik Bhattacharya and Virginia Thorn
What you will be able to do
At work, you will be able to:
- Record the weekly formatting of a stock export as a macro, with relative references so it works from whichever row you start on, and run it from a button.
- Write a stock-check macro in VBA that loops from the first row to the last used row and flags a missing item code or store in a flag column.
- Catch count entries that are not numbers, a note, N/A or a stray character, with IsNumeric, and colour each faulty cell with Interior.Color and RGB.
- Gather every fault on a stock line into one FlagText message, and clear the previous run's flags and fills before each new check.
- Test a macro safely with Debug.Print and the Immediate window before it writes a single flag, then join the checks under one subroutine with an error handler.
- Hand the stock check to storekeepers as a button in a macro-enabled .xlsm workbook, with the macro security and trust settings understood.
- Read, debug and adapt macros you did not write, whether inherited with the stock workbook, downloaded or drafted by ChatGPT or Claude.
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 a sales sheet thousands of rows long, it hands an inventory controller the complete pattern of a stock check: last run's flags cleared, a loop to the last used row, every fault named in a flag column and coloured, and a message when the run is done, with the finished .xlsm to compare.
-
Project 12
SalesFusion
A sales report that refreshes itself from a folder of files.
A Power Query project on raw sales exports, it takes the weekly export clean-up off the macro's hands: steps recorded once and replayed at each refresh, so VBA is left to check what people key in, counts and adjustments above all.
-
Project 13
AutoFlow
The weekly report routine, run by a flow instead of by you.
Made in Power Automate Desktop on Windows, it drives Excel from outside, opening the workbook, reading rows, asking Yes or No and writing the answer back: the route for a stock routine that spans several files and windows, where a macro works inside one workbook.
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
Begin at Lesson 136 if you keep stock records in Excel and write everyday formulas: the section starts with the recorder, and code only arrives once a recorded macro already works for you. Complete beginners start at Lesson 1, which brings in absolute references (Lesson 10) and the IF function (Lesson 29) before the recorder and the first If statement need them. Already running recorded macros on the stock report? Pick up at Lesson 141, when the editor and macro security come in.
17 of 186 lessons · 1 h 16 min
14 VBA and macros in Excel: FormatWizard What a macro is and what FormatWizard becomes, then the recorder: a first macro named, given a shortcut and run, absolute references that replay on the same cells, and relative references that follow whichever row you start from. Formatting a weekly stock export or marking problem lines by hand is exactly the work these recordings take over.
- 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
14 VBA and macros in Excel: FormatWizard Making a macro something the whole stores team can use: the Developer tab, a button and the Quick Access Toolbar, the macro-enabled .xlsm format that keeps the code, then the VBA editor opened with Alt+F11 and the macro security and trust settings that decide when a workbook's code may run.
- 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
- 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 The foundations of code you write yourself: a module and a first line that points at a worksheet, Option Explicit with declared variables and data types, the difference between a Sub and a Function, and GetLastUsedRow, which finds where a stock list ends however many lines were added today.
- 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, one to a lesson: old flags and fills cleared before each run, a For Next loop that flags a missing value, If and Else tests that gather a row's faults into one FlagText message, Interior.Color and RGB for the cell at fault, and IsNumeric for an entry in a number column that is not a number. On stock data these become missing item codes and stores, and counts entered as notes.
- 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 Finishing properly: Debug.Print and the Immediate window to watch what the code reads before it writes, and one master subroutine that runs every check in order behind an error handler, with screen updating off for speed. This is the macro a storekeeper runs every morning.
- 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.
Every morning I scan the stock sheet for blank codes, odd counts and lines to chase: can Excel macros and VBA do that check, and which course teaches them?
Yes, and The Complete Excel Course with AI Integration from Coding Liquids teaches the whole method on FormatWizard, an industry-standard project designed after talking with people from many different industries. You start by recording macros that format a sheet in one click (Lesson 137 to Lesson 139), then write VBA that does what your morning scan does: it clears the previous run's flags, walks every row to the last one in use, writes what is wrong into a flag column, colours the cell at fault and tells you when it has finished (Lesson 146 to Lesson 152). The lessons check a sales sheet for a missing region, a missing salesperson and a per-unit figure that is not a number; on a stock sheet the same loop checks the item code, the store and the counted quantity. This page lists 17 lessons, 1 hour 16 minutes of video, all inside one section you can finish in a few sittings.
What would a FormatWizard-style check look like on my own stock sheet?
A flag column beside your data that names every fault in plain words, built the way The Complete Excel Course with AI Integration builds its validation macro for a sales sheet. The routine runs in a fixed order. It first clears last run's flags and fills (Lesson 146), finds the last used row with a function of your own (Lesson 145), then loops down every row (Lesson 147). Where the lessons test Region and Salesperson for blanks, you test the item code and the store; where they test the per-unit figure with IsNumeric, you test the counted quantity (Lesson 150). Each fault is added to one message, separated by a pipe, so a single line can read Store missing|Count invalid (Lesson 148), and the cell at fault turns light red (Lesson 149). One master routine then runs the lot behind an error handler (Lesson 152), and the sheet tells you exactly where to look.
Every week I format the stock export the same way: can a recorded macro do it without any code?
Yes: record it once and replay it in one click, and The Complete Excel Course with AI Integration teaches the recorder before a line of code appears. Lesson 137 records a first macro, named and given a shortcut, and shows why absolute references replay on the same cells every time; Lesson 138 switches on relative references, so the recording follows whichever row you start on. Lesson 139 puts the macro on a button of the Developer tab and in the Quick Access Toolbar, and Lesson 140 saves the work as a macro-enabled .xlsm, because a plain .xlsx drops every macro. Since a fresh stock export arrives as a new file each week, note the option the first recording lesson points to, the Personal Macro Workbook, which keeps a macro ready whenever Excel opens on that computer. Recorded steps cannot be undone with Ctrl+Z, so try each new recording on a copy of the export first.
Counters write notes and question marks in the quantity column: will a macro find every one before I work out the count differences?
Yes: an IsNumeric check flags every entry in a number column that is not a number, and The Complete Excel Course with AI Integration builds it in Lesson 150. The macro walks the column row by row; where an entry is a word, a note such as N/A or a stray character, it writes a flag beside it and colours both cells light red, so the counter's sheet goes back with every problem marked. Blank counts are caught by the same kind of loop that flags a missing region in Lesson 147, which trims spaces first so a cell holding only blanks still counts as empty. Run the check before any count is set against the system quantity, and no difference is ever worked out from a note. The lesson's own message says invalid rather than missing, so the two faults stay easy to tell apart in the flag column.
After a stock take, can a macro flag every line whose count differs from the system by more than a set amount?
Yes, with the same loop and an If that compares two columns, and The Complete Excel Course with AI Integration teaches every part of it. The loop runs from the first data row to the last used one (Lesson 145 and Lesson 147); inside it, an If test sets the counted quantity against the system quantity, and where the gap is larger than the tolerance you allow, a Recount flag goes into the flag column and the cell turns red (Lesson 148 and Lesson 149). The lessons write If tests on blanks, on data types and on a last row below two (Lesson 146); a test on a difference is written the same way. Put the IsNumeric check first: a note in the count column would otherwise stop the subtraction, and the error handler of Lesson 152 would report it instead of finishing the list. Get the order right and the recount list builds itself in one run.
Should the reorder flag on my stock sheet be a formula or a macro?
Use both, for different jobs, and The Complete Excel Course with AI Integration teaches the formula and the macro alike. A formula keeps a flag live: IF set against the reorder level (Lesson 29), with AND or OR for a second condition (Lesson 33) and conditional formatting to colour it, changes the moment a balance changes. A macro checks on demand and leaves a record: run the stock check and every line at or under its reorder level gets a flag in words, gathered with any other fault on that line into one FlagText message (Lesson 148) and coloured by Interior.Color (Lesson 149). Use the formula for the flag people watch all day, and the macro for the morning check that must also catch a blank code or a count typed as a note. Both rest on the same If logic, so whichever you learn first makes the other quicker to pick up.
Can a macro add each day's receipts and issues to the bottom of the movement log?
Its key piece is taught, the code that finds where a log ends, and The Complete Excel Course with AI Integration builds it as a function you reuse in every macro. GetLastUsedRow searches upward from the bottom of the sheet with Find and returns the last row holding data, guarded by COUNTA so an empty sheet returns zero instead of an error (Lesson 145); the next entry goes one row below it. Writing a value into a chosen cell is the other piece, and the lessons do it on every pass of the loop when a flag is written (Lesson 148). A stock-in form with its own buttons is not built in the lessons; the function, the variables and the cell references it would use are. For a log that only grows, an Excel table helps too: a row pasted below it joins the table by itself, and every PivotTable reading it follows at a refresh (Lesson 65).
Our stock workbook runs on macros its author left behind: is VBA still worth learning just to look after them?
Yes, and that is one of the best reasons to learn it, because a macro nobody can read is a risk to every figure it touches. The Complete Excel Course with AI Integration teaches the reading before the writing: Lesson 141 opens the editor with Alt+F11 and maps the Project Explorer, the modules and the code window, and the macros recorded in the earlier lessons give you real code to read there. Lesson 142 covers macro security and trust settings and clears a compile error, a missing End With, inside the editor. Debug.Print and the Immediate window (Lesson 151) show what an unfamiliar loop reads, row by row, without writing anything to the sheet. Once variables, functions, loops and If statements are familiar (Lesson 144 to Lesson 148), the old modules stop being a black box and become code you can change with confidence.
A free VBA inventory system from GitHub does most of what we need: can the course help me adapt its code safely?
Yes: a downloaded system is only safe once you can read it, and The Complete Excel Course with AI Integration gives you that reading. Before enabling anything, Lesson 142 explains macro security and the yellow bar that disables macros, with the plain rule to enable content only for files you trust. Then the editor (Lesson 141) shows where the code lives, Option Explicit and declared variables (Lesson 144) make its names traceable, and loops, If tests and cell colouring (Lesson 147 to Lesson 149) are the building blocks most inventory macros are made of. Debug.Print lets you watch it read your stock columns before it writes a thing (Lesson 151). Changing which columns it checks, adding a store or retiring a feature becomes an edit you understand rather than a guess. Keep the download untouched and adapt a copy saved as .xlsm (Lesson 140).
Can ChatGPT or Claude write the stock-check macro, and what must I check before it runs on the live register?
They can draft it fast, and The Complete Excel Course with AI Integration makes you the person who decides whether the draft is safe. In Lesson 148 you write parts of the validation macro with Claude or ChatGPT, each in its own window, then correct what comes back. Four things to check before a draft touches the live stock register: that it finds the true last row rather than a fixed one (Lesson 145); that it trims spaces before calling a cell empty (Lesson 147); that a count typed as a note is flagged, not subtracted (Lesson 150); and that an error handler restores the screen and reports what failed (Lesson 152). Run it first on a copy with Debug.Print in place of writes (Lesson 151), because a macro's changes cannot be undone with Ctrl+Z. The lessons give you the words to name each fault in an assistant's code.
Can storekeepers who never open the VBA editor run the stock check from a button?
Yes, and The Complete Excel Course with AI Integration shows every step of handing a macro over. Lesson 139 switches on the Developer tab and puts a macro on a button and in the Quick Access Toolbar with an icon of its own, so the check is one click for anyone at the stores PC. Lesson 140 saves the workbook as a macro-enabled .xlsm, the format that keeps the code; save the same file as .xlsx and every macro disappears. Lesson 142 explains the yellow bar that disables macros when a workbook opens and the Enable Content button that lets them run, which is the first thing a storekeeper will meet. Because the finished macro reports back with a message (Lesson 152), the person pressing the button knows the check ran, and the flag column tells them what to fix.
Our movement log runs to thousands of rows: will a macro check it quickly, and what happens if it fails halfway?
It runs quickly and fails politely, because The Complete Excel Course with AI Integration builds both into the finished macro. Lesson 152 switches screen updating off while the checks run, so Excel stops redrawing the sheet at every row, and turns it back on at the end. The same routine opens with an error handler: if any check fails, control jumps to a block that restores screen updating and shows the error's description, so you learn what went wrong instead of facing a frozen sheet. The loop covers exactly the rows in use, found by the function you build in Lesson 145, which the lesson tests on a sheet thousands of rows long and again after a row is added. The lesson also fixes a quiet fault worth knowing on stock data: two checks writing to one flag cell must append, or the second wipes out the first.
Which stock chores belong to a macro, and which to Power Query or Power Automate?
Each tool has its own chore, and The Complete Excel Course with AI Integration teaches all three, so you choose rather than force one to do everything. A macro works inside the workbook on what people type: count sheets, adjustments and the morning check of the stock register (Lesson 136 to Lesson 152). Power Query owns the export that returns every week with the same faults: steps recorded once and replayed at each refresh, and a whole folder of store files combined (Lesson 166). Power Automate Desktop drives Excel from outside, on Windows, opening a workbook, reading rows, asking Yes or No and writing the answer back (Lesson 183). So when people ask what is replacing macros, the honest picture is a division of labour, with VBA keeping the checks that live inside the file. Office Scripts, the browser's own scripting, are not among the lessons.
Will the macros run on the stores office Mac, and how soon is the first one useful?
On a Mac as on Windows, and the first macro earns its keep early in the section. VBA belongs to 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 every lesson on this page is open to a Mac; the Developer tab screens look slightly different there (Lesson 139), and the keyboard shortcuts shown, such as Alt+F11, are the Windows ones. Excel in a browser does not run VBA at all. By Lesson 140 a recorded formatting macro sits on a button in a saved .xlsm, and the full stock check is complete at Lesson 152. The starter and finished FormatWizard workbooks are there to build on and compare against, completing the course earns a Certificate of Completion, and lifetime access keeps every lesson open for the next chore that deserves a macro.
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
- Formulas for inventory controllers
- XLOOKUP and VLOOKUP for inventory
- Pivot tables for inventory control
- Charts for inventory controllers
- Dashboards for inventory controllers
- Conditional formatting for inventory
- Data cleaning for inventory controllers
- Data validation for inventory control
- Tables, sort and filter for inventory
- Text functions for inventory controllers
- Date functions for inventory controllers
- Dynamic arrays for inventory controllers
- Power Query for inventory controllers
- Power Pivot and DAX for inventory
- Power Automate for inventory
- Copilot in Excel for inventory control
- ChatGPT for inventory controllers
- Claude in Excel for inventory