The Complete Excel Course with AI Integration

Excel macros and VBA for business analysts

Every delivery of an extract brings the same chores: a missing code here, a word in a number column there, and the formatting stakeholders expect, all done again by hand. The Complete Excel Course with AI Integration hands that routine to macros and VBA on FormatWizard, an industry-standard project, and this page picks out its lessons in the order the automation grows: recording, sharing safely, reading code, business rules as checks, then one tested run.

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 the formatting every delivery of an extract needs, with relative references so one shortcut styles whichever row you select, and run it from a button on the Quick Access Toolbar.
  • Hand automation to testers and stakeholders in a macro-enabled .xlsm workbook, and explain the Enable Content bar and the trust settings that decide when its code runs.
  • Open the VBA editor with Alt+F11 and read a recorded or inherited macro module by module, telling a Sub that acts from a Function that returns a value.
  • Find the end of an extract of any length with a GetLastUsedRow function, and clear the last run's flags and fills while the header row stays.
  • Turn data quality rules into VBA: a For Next loop with If and Else tests that writes every fault in a row into one FlagText message and colours the cell at fault.
  • Flag an entry in a number column that is not a number, a word or a note such as N/A, with IsNumeric.
  • Watch code at work with Debug.Print in the Immediate window, then run every check from one subroutine with an error handler that reports what went wrong.

Projects

What you will build.

The course has 14 industry-standard projects. These two matter most here.

  • Project 11

    FormatWizard

    One click that checks a whole sheet for you.

    Built to validate a sheet of sales records, it gives a business analyst a working pattern for data quality rules: each rule a test inside a loop, each fault written into a flag column and coloured in place, the whole run behind one button with an error handler.

  • Project 13

    AutoFlow

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

    Built in Power Automate Desktop, it shows the second way to automate Excel, from outside the workbook: flows that open the file, loop over its rows, ask a person for approval and write the answer back, on Windows, for routines that reach beyond one workbook.

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: FormatWizard's starter workbook and a working knowledge of formulas are all the section asks, and no programming is assumed. Analysts who already record macros can jump to Lesson 141, where the VBA editor opens and reading code begins. Anyone new to Excel itself should take the course from Lesson 1, since the recorder's references and the IF logic behind every check come from its early sections.

17 of 186 lessons · 1 h 16 min

14 VBA and macros in Excel: FormatWizard 3 of 17 lessons · 12 min Recording first: what a macro is and what FormatWizard will become, a first recording named, given a shortcut and run, then relative references that make one recording format whichever row you start from. For a business analyst it is the quickest win: the styling every delivery needs, replayed in a keystroke.
  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
14 VBA and macros in Excel: FormatWizard 4 of 17 lessons · 16 min Sharing and safety: the Developer tab and a button on the Quick Access Toolbar, the macro-enabled .xlsm format that keeps the code, the VBA editor and its workspace, and the macro security and trust settings that decide when a workbook's code may run, the first things a tester or stakeholder meets.
  1. 139 Developer Tab in Excel Run macros from a button and the quick access toolbar 4 min
  2. 140 Save macros in Excel Macro-enabled workbooks and the XLSM file format 3 min
  3. 141 The VBA Editor in Excel Open it with Alt+F11 and learn the workspace 4 min
  4. 142 Working in the VBA editor Macro security, trust settings, switching to Excel 6 min
14 VBA and macros in Excel: FormatWizard 3 of 17 lessons · 14 min Reading and writing code: a module of your own, a line that points the code at a worksheet, Option Explicit and declared variables, the difference between a Sub and a Function, and GetLastUsedRow, which finds where an extract ends however long it grows.
  1. 143 Your first VBA code Modules, worksheets, rows, columns and formatting 4 min
  2. 144 VBA variables and data types Sub vs function for Excel beginners 6 min
  3. 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 Business rules as checks: old flags and fills cleared below the headers, a For Next loop that flags every missing region, If and Else tests that gather each row's faults into one FlagText message, cells coloured with Interior.Color and RGB, and IsNumeric flagging entries in number columns that are not numbers. The lessons use a sales sheet; any extract with mandatory fields is checked the same way.
  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 show what the code reads before it writes, then one subroutine runs every check in order behind an error handler, with screen updating off for speed, the master macro a business analyst can hand over.
  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.

What would a business analyst do with Excel macros and VBA, and how does someone who has never coded learn them?

Automate the checks repeated on every extract and read the macros a process inherits, and The Complete Excel Course with AI Integration from Coding Liquids teaches both from a first recording, with no coding assumed. Its VBA section builds FormatWizard, an industry-standard project designed after talking with people from many different industries: a sales sheet of several thousand rows that one macro checks in a single run, flagging missing regions and salespeople, marking entries in number columns that are not numbers and colouring each fault. On the way you record and share macros, open the VBA editor and write variables, a function, If statements and loops yourself. This page picks out the whole section, 17 lessons and 1 hour 16 minutes of video, in the order a business analyst would put them to work. Complete the course and a Certificate of Completion follows, with a macro behind it that you can explain line by line.

Of the data chores in a project cycle, which ones should a business analyst hand to VBA?

The ones that repeat with the same layout every time, and The Complete Excel Course with AI Integration teaches a macro for each kind. Formatting a fresh delivery the way stakeholders expect becomes a recorded macro on a button (Lesson 137 to Lesson 139). Clearing last cycle's results while the header row stays takes a few lines of VBA (Lesson 146). Checking every row against a rule, a missing region, a missing salesperson, a word where a figure belongs, is a loop with If tests (Lesson 147 to Lesson 150), and a function of your own finds where the data ends (Lesson 145). What stays with you is the judgement: which rules matter, what each flag means and who fixes it. Pulling data from databases or other Office programs by code is outside these lessons; the checking, flagging and formatting that fill a delivery day are all here.

Each test cycle brings a fresh extract: can a macro check every row of it against the rules in my requirements?

Yes, and FormatWizard in The Complete Excel Course with AI Integration is built to do exactly that kind of checking, on a sales sheet. A For Next loop visits every row from the first record to the last (Lesson 147); inside it, If and Else tests write a message for each rule a row breaks, a missing region or a missing salesperson, joined into one FlagText entry with a pipe between them (Lesson 148). Interior.Color with an RGB mix paints the cell at fault a soft red (Lesson 149), and IsNumeric flags an entry in a number column that is not a number, a word or a note such as N/A (Lesson 150). Swap the course's rules for the ones in your requirements and each cycle's extract is checked row by row in one run, every defect named beside the row that caused it, ready to filter and pass to whoever fixes it.

Every delivery has a different row count and last cycle's flags still sit in the sheet: how does the macro handle both?

With a function that finds the last used row and a routine that resets the flag column below the headers, both written in The Complete Excel Course with AI Integration. GetLastUsedRow (Lesson 145) first uses COUNTA to make sure the sheet is not empty, then searches upwards from the bottom with Find, so it lands on the last record of the course's sheet and on the new last record the moment another row is pasted in. Every check then loops to that row, whatever the size of the delivery. Before a run, a reset routine (Lesson 146) clears the messages and fill colours from the second row down, leaving the header untouched, and stops with a warning when the sheet holds only headers. For a business analyst that means each test cycle starts clean: no defect from the previous extract survives into the new one, and nothing beyond the last record is ever checked.

Before a data migration, can a macro mark the legacy records that would fail the target system's rules?

Yes: mandatory fields and data types, two of the first rules a migration tests, are exactly what FormatWizard checks in The Complete Excel Course with AI Integration. A field the target requires, a region or a salesperson in the course's sales data, is tested inside a loop with Trim, so a cell holding only spaces still counts as empty (Lesson 147, Lesson 148). A field the target expects as a number is tested with IsNumeric, which flags a word, a note such as N/A or a stray character where a figure belongs (Lesson 150). Each failing record gets its reasons written beside it and its cells coloured (Lesson 149). Run it over the legacy extract before the load and the list of records to cleanse builds itself, every fault named. Matching legacy records to their partners in the target extract is lookup work, which the course teaches with XLOOKUP and FILTER (Lesson 69, Lesson 76).

The as-is process runs on macros nobody documented: can I learn to read them well enough to write them up?

Yes, reading comes before writing in The Complete Excel Course with AI Integration, and it is the skill a process write-up needs. Lesson 141 tours the VBA editor: the Project Explorer and its modules, the code window, the drop-down that moves between macros, and the objects standing for each sheet and the workbook. Lesson 142 then works with a recorded macro and finds what it leaves out: it formats a row without ever checking that the amount is negative, exactly the kind of hidden assumption an as-is write-up must capture. From Lesson 143 you learn what each line means, which workbook and sheet the code points at, what a variable holds and how a Sub differs from a Function, and Debug.Print shows in the Immediate window what a routine reads, row by row, without touching the sheet (Lesson 151). An undocumented macro becomes steps and business rules you can write down and confirm with the people who run it.

Can ChatGPT or Claude draft a validation macro from the business rules I have written?

They can draft one, and The Complete Excel Course with AI Integration has you try it in Lesson 148: once the two-check loop is built, learners write parts of the macro with Claude or ChatGPT, each in its own window, and correct what comes back. Written rules make a strong prompt, because a business analyst already states each rule precisely: which column, which condition, which message. What an assistant cannot do is vouch for its code, so the section trains the questions to ask of it. Does the loop stop at the last used row (Lesson 145)? Does a cell of spaces count as blank (Lesson 147)? What happens when a word turns up in a number column (Lesson 150)? Does Debug.Print show the right cells being read before anything is written (Lesson 151)? A draft that passes all four is ready for test data; one that fails never touches a stakeholder's file.

Will learning VBA help me write better automation requirements for developers?

Yes, because the questions a developer will ask become questions you have already answered, and The Complete Excel Course with AI Integration puts each one in front of you as you build. Where does the data end, and what if the sheet is empty (Lesson 145, Lesson 146)? Is a cell of spaces blank (Lesson 147)? When one row breaks two rules, are both reported, or does the second message overwrite the first (Lesson 148, Lesson 152)? When the code meets an error halfway, does it crash or report what went wrong (Lesson 152)? Should a fault be coloured, written down or both (Lesson 149)? A business analyst who has built FormatWizard writes those answers into the specification as acceptance criteria, so the build starts from settled rules. You also gain the developer's vocabulary, Sub, Function, variable, loop, error handler, and the conversation runs both ways.

Before every steering meeting I restyle the same extract by hand: can a recorded macro take that over without code?

Yes, and it is the first thing the section automates, with no code typed. In Lesson 137 of The Complete Excel Course with AI Integration you record the restyling once, name the macro, give it a letter for its shortcut and replay it whenever a new extract lands. A plain recording repeats the exact cells it was made on, which is why Lesson 138 turns on Use Relative References: the macro then follows the row you select, so one keystroke handles each row that needs it. Stored in the Personal Macro Workbook, the macro is ready in any file you open on that machine, and placed on the Quick Access Toolbar (Lesson 139) it puts the steering-pack look a single click away. A workbook that carries its own macro is saved as .xlsm (Lesson 140), the format that keeps the code. Since Ctrl+Z cannot reverse what a macro did, rehearse each new one on a copy.

My test workbook goes to UAT testers who have never run a macro: what do they need to know first?

Three things, each taught in The Complete Excel Course with AI Integration. The file must stay macro-enabled: Lesson 140 shows that a standard .xlsx strips out every macro when saved, so the workbook travels as .xlsm. When they open it, Excel holds the code back behind a yellow bar until they press Enable Content, and Lesson 142 explains the trust settings behind that bar, with the rule to enable content only for files you trust, which is why testers should know the file comes from you. And they need no editor: Lesson 139 puts the macro on a button and on the Quick Access Toolbar, so a tester clicks once and reads the flags. Add the error handler of Lesson 152, which reports a problem in a message instead of crashing, and a tester who has never seen VBA can run the full check unaided.

When a macro misbehaves on a stakeholder's file, how do I find out why?

With the debugging habits The Complete Excel Course with AI Integration builds into the section, starting from errors that happen along the way. Compile errors are read and fixed as they appear: a missing End With (Lesson 142), an undeclared variable that Option Explicit catches (Lesson 150), a misspelt call (Lesson 152). For code that runs but does the wrong thing, Debug.Print writes what the routine sees into the Immediate window, opened with Ctrl+G, so you can confirm it reads the right column in the right order before it writes anything (Lesson 151). Lesson 149 shows the classic slip, a copied line still pointing at column B when it should test column C, so the wrong cells light up. And the error handler of Lesson 152 turns a crash into a message carrying the error's description, so a stakeholder can tell you exactly what happened in their file.

The finished macro checks a sales sheet: how much has to change before it checks one of my extracts?

Less than you might expect: the structure stays and only the references change, and The Complete Excel Course with AI Integration gives you the finished FormatWizard workbook to start from. The sheet name sits in the one line that sets the worksheet (Lesson 143); point it at your extract's sheet. Each check names its column by letter, region in B, salesperson in C, the per-unit figure in F, the flag in H, so you change the letters to your columns and the messages to your rules (Lesson 147 to Lesson 150). GetLastUsedRow and the error handler need no change, and the reset needs only your flag column's letter (Lesson 145, Lesson 146). The lessons use sales records; a requirements log, a test results export or a migration extract is checked the same way. Keep the original beside your copy, and every edit can be compared with code that works.

IT says desktop routines are moving to Power Automate: should a business analyst still learn VBA, or skip to flows?

Learn both, because they suit different jobs, and The Complete Excel Course with AI Integration teaches both. VBA lives inside the workbook and is the quicker of the two on big sheets: the course notes that a macro usually runs faster than a desktop flow working through rows one by one (Lesson 185). Power Automate Desktop works from outside, opening Excel, reading and writing cells and asking a person for approval, and it records a visual flow that colleagues can inspect without reading code (Lesson 181). Its section, AutoFlow, needs Windows and follows the VBA section in the course (Lesson 174). For a business analyst, VBA is also the language of the legacy macros a process already depends on, so reading it stays useful whatever IT moves next. Office Scripts, the browser's scripting, are not taught; desktop VBA and desktop flows are, each to a working finish.

I learn on a Mac and some stakeholders only use Excel in a browser: where will my macros run?

In desktop Excel, on Windows or on a Mac, which is where The Complete Excel Course with AI Integration teaches them; a browser will not run them. The course's requirements name Windows only for Power Pivot and Power Automate, so every VBA lesson, from the first recording (Lesson 137) to the finished validation macro (Lesson 152), can be followed on a Mac. Two differences to expect: the lessons are recorded on Windows, so shortcuts such as Alt+F11 for the editor are the Windows ones, and Lesson 139 notes that a Mac's screens for the Developer tab look slightly different. For stakeholders who live in the browser, run the check yourself on the desktop and send them the flagged workbook: the flags and colours are ordinary cell contents and formats, so they read the same anywhere. Browser scripting is a separate tool and stays outside these lessons.

In my requirements, which rules belong in a drop-down at the point of entry and which in a macro that checks the batch?

Each kind has its place, and The Complete Excel Course with AI Integration teaches both. A rule that a person applies while typing belongs in data validation: a drop-down list of allowed values stops a wrong entry at the moment it is keyed (Lesson 45, and on TaskFlow's status and priority columns in Lesson 81). Excel checks an entry only when it is typed, though, so data that arrives from another system, an extract or a migration file, never meets the list. That batch needs a check that reads what is already there: FormatWizard's loop, which tests every row for missing values and for entries in number columns that are not numbers, and writes the reason beside each one (Lesson 147 to Lesson 150). Write entry rules as validation and batch rules as checks, and each fault is caught where it starts.

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.