The Complete Excel Course with AI Integration
Excel macros and VBA for data analysts
For analysts who open the same extract every week and spend the first stretch of the day checking it by eye: blanks in key columns, words where figures belong, rows to mark before analysis can start. The Complete Excel Course with AI Integration hands that routine to FormatWizard, an industry-standard project, and this page picks out its lessons in order: recorded macros, the VBA editor, a function that finds where the data ends, loops and flags, IsNumeric checks, debugging and one master macro.
Taught by Sagnik Bhattacharya and Virginia Thorn
What you will be able to do
At work, you will be able to:
- Record a formatting macro with absolute references, then again with relative references, so one shortcut marks whichever exception row of an extract you select.
- Run a macro from the Developer tab or a Quick Access Toolbar button, and keep it in a macro-enabled .xlsm workbook that colleagues can open once they trust it.
- Read and edit recorded code in the VBA editor, and write modules under Option Explicit that address a worksheet, its rows, its columns and their formatting.
- Fit a macro to an extract of any length with GetLastUsedRow, a VBA function of your own built on Find, so no loop stops short or runs past the data.
- Check every record in a For Next loop: flag missing regions and salespeople, gather each row's faults into one FlagText message and colour the cells at fault with RGB.
- Flag the entries in a figure column that are not numbers at all, such as words, N/A or stray characters, with IsNumeric before any total or average reads them.
- Clear the previous run's flags and fills before each pass, so every validation starts from a clean Flag column.
- Watch code at work with Debug.Print and the Immediate window, then run every check from one subroutine with an error handler and screen updating switched off for speed.
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 extract thousands of rows long, it ends as a data-quality tool: a function that finds the last record, loops that flag gaps and entries that are not numbers, coloured cells, a Flag column you can filter and an error handler around it all.
-
Project 12
SalesFusion
A sales report that refreshes itself from a folder of files.
Where the import and consolidation analysts once scripted now happen without code: messy CSV files cleaned and a whole folder of them combined in Power Query, leaving your VBA free to check what arrives.
-
Project 13
AutoFlow
The weekly report routine, run by a flow instead of by you.
The code-free counterpart to a macro, on Windows: Power Automate Desktop drives Excel from outside, reading, writing and looping over rows, and its closing challenge says plainly when VBA is the quicker choice.
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 you write formulas with confidence but have never recorded a macro: the section assumes no programming. Already recording macros? Go to Lesson 141, where the editor opens and the writing begins. New to Excel itself? Begin at Lesson 1 and come here once formulas feel natural. The Flag column the finished macro fills is filtered like any other column (Lesson 21), so a few minutes on filtering turn its output into a list of rows to fix.
17 of 186 lessons · 1 h 16 min
14 VBA and macros in Excel: FormatWizard Macros before any code: what a macro and VBA are, a first recording that formats a row holding a negative amount, named and given a shortcut, and the switch to relative references that lets one recording mark whichever row you start from, the quickest win for an analyst who formats exceptions by hand.
- 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 part of the workbook: the Developer tab, a button on the Quick Access Toolbar, and the macro-enabled .xlsm format, without which an ordinary save strips every macro out of the file you hand to a colleague.
- 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 From reading code to writing it: the VBA editor opened with Alt+F11, macro security and the trust settings for files from elsewhere, a first module that points at the Data sheet, variables and data types under Option Explicit, a Sub set against a Function, and GetLastUsedRow, which tells every later routine where an extract of any length ends.
- 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 data-quality checks, one per lesson: a routine that clears the last run's flags and fills, a For Next loop that flags missing regions, If and Else tests that gather missing regions and salespeople into one message per row, cells coloured with Interior.Color and RGB, and IsNumeric, which flags entries in a figure column that are not numbers.
- 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 the tool: Debug.Print and the Immediate window confirm the code reads the right cells in the right order before it writes a single flag, then RunFullValidation calls every check in turn 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.
Can a data analyst learn Excel macros and VBA by building a working tool?
Yes: 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. It starts from the analyst's everyday problem, a long sales extract that must be checked before anyone trusts a total, and it ends with a macro that checks every row for you. You record and run macros first, then open the VBA editor and write the real tool: a function that finds the last row, loops that flag missing values, IsNumeric checks for entries that are not numbers, coloured cells, debugging in the Immediate window and an error handler around it all. This page picks out 17 lessons, 1 hour 16 minutes of video, inside a course of 16 hours that stays yours with lifetime access, and the starter and finished workbooks come with it.
Which parts of an analyst's data preparation can a macro take over?
The checking, marking and formatting that come before any analysis. The Complete Excel Course with AI Integration builds each on a sales extract in FormatWizard: a recorded macro formats an exception row in one keystroke (Lesson 137 and Lesson 138); a loop flags every row with a missing region (Lesson 147); a second test catches missing salespeople and writes one combined message per row (Lesson 148); the cells at fault turn light red (Lesson 149); and IsNumeric flags figure entries that are not numbers at all (Lesson 150). Before any of that, Lesson 146 clears the previous run's flags, so every pass starts clean. What is left for you is the part worth your time, deciding what the flagged rows mean for the analysis. The lessons check sales records; a survey export, a web analytics download or a CRM extract is checked the same way.
Do data analysts still use VBA, or have Python and Power Query replaced it?
They still use it, for a different job from the other two, and The Complete Excel Course with AI Integration teaches VBA alongside Power Query so you can tell which is which. Power Query owns the repeatable import: SalesFusion cleans messy CSV files and combines a whole folder of them on refresh (Lesson 166), work analysts once wrote loops for. VBA owns what happens inside the workbook afterwards: checking every row against your rules, colouring and flagging what fails, formatting a report in one click and stopping with a clear message when something goes wrong, which is what FormatWizard builds (Lesson 152). Python is not taught; a great deal of analysis is still built and delivered in Excel workbooks, which is where VBA lives. Learn both Excel tools and each task goes to the one built for it, which is also how you read and maintain the macros your team already runs.
If ChatGPT drafts a macro for my analysis, how do I know the code is safe to run?
By reading it the way the course teaches you to write it. The Complete Excel Course with AI Integration has you write parts of the FormatWizard macro with Claude or ChatGPT and correct what comes back (Lesson 148), and the section supplies the questions that make an AI draft safe. Does the loop end at the true last row, as GetLastUsedRow ensures (Lesson 145)? Does a cell of spaces count as empty, as Trim makes it (Lesson 147)? Does the code read the cells you think, which Debug.Print shows in the Immediate window before anything is written (Lesson 151)? Does it stop with a message instead of crashing (Lesson 152)? Remember too that Ctrl+Z cannot undo a macro (Lesson 137), so a draft is tried on a copy first, and the AI section's QA checklist (Lesson 99) adds the habit of checking every result.
Will a macro still run correctly after new rows are pasted under my data?
Yes, because FormatWizard never assumes where the data stops. In The Complete Excel Course with AI Integration, Lesson 145 builds GetLastUsedRow, a function that searches upwards from the bottom of the sheet with Find to return the last row holding anything, and guards against an empty sheet with COUNTA. The lesson proves it on the spot: the function reports the last row, one more row is pasted in, and the next run reports that new row. Every check that follows loops from row 2 to whatever the function returns (Lesson 147), and the clean-up routine refuses to run on a sheet that holds only headers (Lesson 146). So this week's extract, longer or shorter than last week's, is checked to its final record without a line of code being touched. A recording with fixed references cannot manage that, which is the first good reason to move from recording to writing VBA.
Before I average a column, can a macro prove every entry in it is a number?
Yes: Lesson 150 of The Complete Excel Course with AI Integration writes exactly that check with IsNumeric. A loop visits every row of a figure column, and wherever an entry cannot be read as a number, a word, an N/A or a stray character, the macro colours that cell and its flag cell light red and writes an invalid message in the Flag column, so the faulty rows are named before any total, average or PivotTable reads them. The lesson's own run finds such a row and marks it. The message says invalid rather than missing on purpose, since an empty cell and a wrong entry are different faults caught by different checks, the blanks being the job of Lesson 147. That difference matters in analysis: a blank may be a gap in collection, while a word in a number column usually points to a broken export that the source owner should hear about.
Once the macro has flagged the rows, how do I turn the flags into a data-quality summary?
With the Excel you already use, because FormatWizard writes its findings as plain text in a Flag column. In The Complete Excel Course with AI Integration the macro writes Region missing, Salesperson missing or an invalid message beside each faulty row, joined with a pipe when a row has more than one fault (Lesson 148), and colours the cells at fault (Lesson 149). That column then behaves like any other: filter it to see the faulty rows alone (Lesson 21), count the flags with COUNTIF (Lesson 36), or put it in a PivotTable beside region and date to see where the gaps cluster (Lesson 60). An analyst ends up holding more than a cleaned file: a summary of data quality to send back to whoever owns the source, in the same form every week, which is how sources actually get fixed.
Can a recorded macro handle the formatting I repeat on every weekly report?
Yes, and the first one works before any code appears. The Complete Excel Course with AI Integration records a macro in Lesson 137: you name it, give it a letter shortcut, store it in the workbook and format a row bold, italic and highlighted, then replay it in one keystroke. Lesson 138 switches on relative references, so the same recording works from whichever row you select, and Lesson 139 puts it on the Quick Access Toolbar as a button. You also meet the Personal Macro Workbook, which keeps a macro available every time Excel opens on your computer, handy for formatting you apply to every new extract. The recorder has a limit worth knowing: it replays exactly what you did, with no judgement about which rows need it, which is why the section moves on to VBA that decides for itself.
Will colleagues be able to run my macro workbook, and what will Excel ask them first?
Yes, once two things are right, and The Complete Excel Course with AI Integration covers both. The workbook must be saved in the macro-enabled .xlsm format: an ordinary save strips every macro out, which Lesson 140 shows when Excel refuses the plain save and Save As takes over. Then expect the yellow bar announcing that macros have been disabled: Excel holds back the code in a file until the person opening it chooses Enable Content, and Lesson 142 explains the macro security and trust settings behind that bar, with the rule to enable content only for files you trust. Once enabled, Developer, Macros and Run starts the macro on any colleague's PC (Lesson 139), and the closing message that FormatWizard shows at the end of each run tells them it finished, while its error handler explains anything that went wrong.
How much programming do I need before the VBA lessons?
None. The Complete Excel Course with AI Integration opens the section with recording, so your first macros need no code at all (Lesson 136 to Lesson 140), and when code arrives it comes one idea per lesson, each added to the same macro. An analyst brings more to it than they expect: a VBA If statement decides the way the IF function does, a For Next loop does for every row what a formula filled down does for one, and VBA's Trim does much what the TRIM function does on the sheet. Lesson 144 explains variables and data types for beginners, Option Explicit catches a mistyped name before it becomes a bug, and Lesson 151 turns debugging into a calm routine of watching values in the Immediate window. Stuck on a line of your own? The instructor support plan sends your question to the instructor, answered in writing, for two months that begin when you switch it on.
Should a VBA loop or Power Query combine my folder of CSV exports?
Power Query, and The Complete Excel Course with AI Integration teaches it for exactly that job. Lesson 166 points Power Query at a folder, combines every CSV in it into one table with a column naming each row's source file, and applies the same cleaning steps to every file, so next week's export joins on refresh with no code at all; Lesson 167 adds profit metrics and fiscal year columns on top. A VBA loop that opens files one by one is not part of the macro lessons, and Power Query does that job with far less to maintain. Where VBA earns its place is after the import: running FormatWizard's checks over the combined table and flagging and colouring whatever fails (Lesson 152). The course gives you both tools, in the order the work happens, so each does what it does best.
Will I write my own VBA functions, or only macros that run steps?
Both. The Complete Excel Course with AI Integration sets out the difference in Lesson 144: a Sub performs an action and returns nothing, while a Function hands a result back to whatever called it. Lesson 145 then builds a Function of your own, GetLastUsedRow, with Find, a COUNTA guard and Exit Function, and Lesson 146 makes it Public so routines in other modules can call it, which is how every check in FormatWizard learns where the data ends without repeating the code. That habit, one small tested function reused everywhere, keeps an analyst's macros short and trustworthy. Functions typed into a worksheet cell as custom formulas are not a lesson of their own; the Sub and Function logic they rest on is taught here in full, on a working tool.
Will a macro keep up with thousands of rows, or crawl?
It keeps up, and The Complete Excel Course with AI Integration shows the habits that make the difference. FormatWizard's data runs to thousands of sales rows, and Lesson 152 wraps the whole validation in Application.ScreenUpdating set to False, so Excel stops redrawing the sheet while the loops work and the run goes faster; the error handler switches updating back on even if something fails, so a fault never leaves Excel looking frozen. The second habit is reading no more than you must: GetLastUsedRow (Lesson 145) stops every loop at the real last record instead of crawling through empty rows. For comparison, Lesson 185 loops through a long sheet with Power Automate Desktop, a Windows tool, and notes that a VBA macro would usually run faster, while a flow shows its logic visually. Fast row-by-row checking is VBA's home ground.
How soon could a macro be checking my own extracts?
Within 1 hour 16 minutes of video, and a recorded macro is useful far sooner. In The Complete Excel Course with AI Integration, a formatting macro you can run on any extract exists by Lesson 138, and by Lesson 140 it sits on a button in a macro-enabled file. The checks arrive one short lesson at a time after that, until Lesson 152 joins them into the finished validation macro. To aim it at your own data, change the sheet name and the column letters the checks read, then test it on a copy, with Debug.Print (Lesson 151) showing whether it reads the right cells before it writes anything. The macro lessons are shown on Windows with its shortcuts, yet the requirements name no Windows need for them, so Excel for Mac follows along with a few screens looking slightly different (Lesson 139). The starter workbook and the finished macro-enabled file both come with the course.
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 data analysts
- Lookups for data analysts
- PivotTables for data analysts
- Charts for data analysts
- Dashboards for data analysts
- Conditional formatting for data analysts
- Data cleaning for data analysts
- Data validation for data analysts
- Excel tables for data analysts
- Text functions for data analysts
- Date functions for data analysts
- Dynamic arrays for data analysts
- Power Query for data analysts
- Power Pivot and DAX for data analysts
- Power Automate for data analysts
- Copilot for data analysts
- ChatGPT for data analysts
- Claude in Excel for data analysts