The Complete Excel Course with AI Integration
Excel macros and VBA for treasury analysts
Each morning a treasury analyst formats the same statements and scans the same payment batch for gaps, with a bank cut-off ahead. The Complete Excel Course with AI Integration turns that routine into macros and VBA on FormatWizard, its industry-standard checking project, in this order: recorded formatting, a last-row function, loops that flag each fault with its reason, IsNumeric, Debug.Print and one master routine guarded by 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 a macro that applies a cash report's house formatting, with relative references so it works from any row, and run it from a Quick Access Toolbar button.
- Keep macros in a macro-enabled workbook or the Personal Macro Workbook, so they run on each morning's new bank file.
- Write VBA that finds the last row of a statement or payment file of any length with a reusable function.
- Loop through a payment batch or a deal register with For Next and If, writing the reason for every fault into a flag column and colouring the cell.
- Flag an amount or rate cell holding a word, a note such as N/A or a stray character with IsNumeric, before the figures are used.
- Check what the code reads with Debug.Print, then run every treasury check from one master macro with an error handler.
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 around a sheet of sales rows, it is the pattern for every check a treasury file needs before it leaves the desk: the last row found by a function, each row visited by a loop, gaps and non-numbers flagged with their reason and coloured, and the whole run started by one master routine that reports its own errors.
-
Project 13
AutoFlow
The weekly report routine, run by a flow instead of by you.
Built to run a weekly sales report, it handles what VBA leaves outside the workbook: Power Automate Desktop flows, on Windows, that launch Excel, read its rows and record desktop and browser steps, the kind a statement download from a bank portal takes before your macro checks the file.
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 coding background: the section opens with recorded macros and adds VBA one step at a time, and the IF function of Lesson 29 makes its If statements feel familiar. Someone opening Excel for the first time starts at Lesson 1. Already recording macros? Go to Lesson 141 for the editor, or to Lesson 146, where the checking loops begin.
17 of 186 lessons · 1 h 16 min
14 VBA and macros in Excel: FormatWizard Recording comes first: the idea of a macro and of VBA, a formatting macro recorded with absolute references and again with relative ones so it acts on whichever row you start from, the Developer tab and a Quick Access Toolbar button to run it, and the macro-enabled file format that keeps the code. For a treasury desk, the house formatting of a cash report applied in one keystroke.
- 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 Code at last: Alt+F11 into the editor and its workspace, macro security with Enable Content kept for trusted files, a first line that points code at a sheet by name, declared variables under Option Explicit, and a reusable function returning the final row of data, so a check reaches the bottom of a statement or payment file of any length.
- 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 themselves: old flags cleared before each run, a For Next loop down every row, If tests that write the reason for each fault into a flag column, empty cells coloured with RGB, and IsNumeric marking a word or symbol sitting where a figure belongs. On treasury files these become a missing beneficiary account, a deal without its maturity date and an amount or rate cell holding a note such as N/A.
- 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 Proof and control: Debug.Print, whose output lands in the Immediate window, to see which cells the code reads before it writes a flag, then one master macro that runs every check in order with screen updating off and an error handler that reports what went wrong instead of stopping cold.
- 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.
Excel macros and VBA for treasury analysts: how much of the daily bank-file routine could a macro take over, and could I build it myself?
Most of the checking and formatting, and The Complete Excel Course with AI Integration from Coding Liquids has you build it yourself on FormatWizard, one of its industry-standard projects, designed after talking with people from many different industries, whose finished macro checks a whole sheet of rows from one button. The path through it, 17 lessons and 1 hour 16 minutes in all, starts with recorded macros and a toolbar button, then moves into code: variables, a last-row function, loops that write the reason for each fault into a flag column, IsNumeric for words where figures belong, Debug.Print and a master routine with its own error handler. The practice sheet holds sales rows, and the structure carries straight to treasury files: a payment batch checked line by line before release, a deal register scanned for gaps, a statement export formatted the house way. You work from a starter workbook and can open the completed macro-enabled one whenever your code needs a working answer beside it.
Before a payment batch goes to the bank, can a macro check every line for a missing account number or a word where the amount should be?
Yes, and those are the two kinds of check The Complete Excel Course with AI Integration builds in FormatWizard. A For Next loop in Lesson 147 walks down every row and tests a column for an empty cell, using Trim so a cell holding only spaces still counts as empty; point it at the beneficiary account or bank code and every gap is caught. Lesson 150 adds IsNumeric, which flags any entry in a figures column that cannot be read as one, such as a word, a note like N/A or a stray character, and colours the cell. Lesson 149 paints each fault light red with RGB, and the reason goes into a flag column, so the person releasing the batch sees what is wrong, not just where. A duplicate payment needs a different test: a COUNTIFS column, taught in Lesson 37, can mark a beneficiary and amount that appear twice.
My deposit and loan register needs a counterparty, a maturity date and a rate on every deal: can one pass of a macro list everything missing on a line?
Yes: Lesson 148 in The Complete Excel Course with AI Integration builds exactly that kind of message, one text per row holding every fault found. The lesson's macro checks two columns in a single loop and collects its findings in a variable called flagText, emptied at the start of each row so one deal's faults never carry into the next, with a pipe between messages; on your register, a deal lacking both would read Counterparty missing | Maturity missing. Add a third test for the rate and the same basket holds it. Lesson 149 colours each empty cell as well as writing the text, so the register shows its faults at a glance and explains them on the same line. Before any of it runs, the cleanup macro of Lesson 146 empties the flag column of the previous run's messages and fills, so the reasons always describe today's register.
Each bank's statement arrives as a new file every morning: where does the macro live so it can run on each one?
In a workbook built to hold code, and The Complete Excel Course with AI Integration shows both homes for it. Lesson 140 explains why a standard workbook will not do: saved as .xlsx it strips out every macro, while the macro-enabled format keeps the code with the data, so the checking tool is one .xlsm file you open each morning. Lesson 143 has the code find its sheet by name, so the day's statement is pasted into that named sheet and the macro runs on whatever arrived. For recorded formatting you want on any file at all, Lesson 137 points to the Personal Macro Workbook, which keeps a macro available whenever Excel opens on that computer. Lesson 139 then puts the macro on a Quick Access Toolbar button, so the morning check is one click away from the moment the file lands.
I recorded a macro to format overdrawn accounts, yet it formats whichever row I am on: why, and what fixes it?
Because a recorder copies actions, not judgement, and The Complete Excel Course with AI Integration shows both the limit and the cure. Lesson 137 records a formatting macro with absolute references, so it always formats the row it was recorded on; Lesson 138 switches to relative references, so it formats whichever row you start from. Neither looks at the figure: Lesson 142 points out that the recorded code formats without checking that the amount is negative. Judgement arrives with VBA. Lesson 146 uses an If test, a comparison that stops the macro when the sheet holds only headers, and Lesson 147 puts If tests inside a loop that visits every row. A test for a balance below zero is the same kind of If, so the finished macro formats the overdrawn accounts and leaves the rest alone, on a statement of any length.
Payments have to reach the bank before its cut-off: will a macro get through a long batch quickly enough?
Yes, and The Complete Excel Course with AI Integration teaches the settings that keep a long run quick. The FormatWizard sheet runs to thousands of rows, and the loop of Lesson 147 visits every one of them, stopping at the last used row that the function of Lesson 145 finds, so a batch of any length is checked end to end with nothing hard-coded. Lesson 152 turns screen updating off while the checks run, which speeds the work because Excel stops redrawing the sheet at every step, and turns it back on at the end, even when an error interrupts the run. Launched from a Quick Access Toolbar button (Lesson 139), the whole check is one click, and the flags are waiting in their column by the time the release screen opens. The time saved comes back every morning, right when the cut-off is closest.
If the checks stop halfway through on a busy morning, can I simply run them again?
Yes, and the way the macro is built makes a second run safe. In The Complete Excel Course with AI Integration the master macro of Lesson 152 wraps every check in an error handler: when something fails, it restores screen updating and shows Excel's own description of the error, rather than leaving a frozen screen and a half-finished sheet behind. The first routine it calls is the cleanup of Lesson 146, which clears the old messages and fill colours from the flag column before any check writes, so a rerun starts from a clean column instead of piling new flags on old ones. That matters because Ctrl+Z cannot undo a macro, as Lesson 137 warns. Fix the cause the message names, click the button again, and the flags describe the batch as it now stands, with nothing left over from the failed attempt.
Treasury controls say the checker must not alter payment data: does the macro only flag, or does it edit?
It only flags, and that is how The Complete Excel Course with AI Integration builds it. Every check in FormatWizard writes into a flag column of its own and colours cells, and none of them changes a value in the data: the loops of Lesson 147 and Lesson 148 write reasons beside each row, Lesson 149 and Lesson 150 add colour, and the cleanup of Lesson 146 empties nothing but the flag column. That separation suits a treasury control, where whoever checks a batch should never be the one who changes it: the amounts and account details the bank receives are exactly those that were entered, and the flags are the evidence of what was checked. Saved in the macro-enabled format (Lesson 140) and opened with Enable Content only when the file is trusted (Lesson 142), the tool itself stays under the same care as the data.
How do I prove the macro reads the right columns before it marks a live batch?
Debug.Print gives you that proof, and The Complete Excel Course with AI Integration teaches it in Lesson 151. The lesson prints a counter, then each row number beside the value the code reads from a column, into the Immediate window, which writes nothing to the sheet and raises no pop-up, so you can watch the macro read the first rows of a batch and confirm they are the right cells, in the right order, before a single flag is written. Option Explicit, from Lesson 144, forces every variable to be declared, so a mistyped name stops the code instead of quietly reading nothing, and the compile errors the lessons meet and fix, a missing End With and a missing Dim among them, show what the editor catches for you. Run the first passes on a copy of yesterday's batch, so a wrong column costs nothing.
Could one button run every morning check, on the payment batch, the deal register and the rate tab in turn?
Yes: Lesson 152 in The Complete Excel Course with AI Integration builds a master macro, RunFullValidation, that calls separate check routines one after another under a single error handler. Each routine in the lessons names its own sheet (Lesson 143 shows how code points at a worksheet by name), so one routine can be aimed at the payment batch, another at the deal register and a third at the rate tab. The last-row function of Lesson 145, made Public in Lesson 146 so any module can call it, is written once and shared by all of them. The lesson also shows the trap when two routines write to the same flag cell, and has the second add its message after a pipe instead of erasing the first. Put the master macro on the Quick Access Toolbar (Lesson 139) and the whole morning's checking starts from one click.
Our banks lay out their statements differently: will one macro check them all?
One routine per layout, or one layout for every bank, and The Complete Excel Course with AI Integration teaches both ways. The FormatWizard checks name their columns by letter, so a routine reads exactly the column it is told: Lesson 149 copies the line that colours a missing region into the salesperson check, changing B to C, and warns that forgetting the change lights up the wrong column. A second bank's layout is the same move, a copy of the routine with its letters changed, called from the master macro beside the first. The other way is to give every bank's file the same columns before any macro sees it: Power Query, taught from Lesson 153, can do that and keep the steps for every refresh, so one set of checks fits all of your banks. Either way, a new bank costs a few edits, not a new macro.
Claude drafted a loop for my payment checks: what in the lessons tells me whether it is right?
The reading skills The Complete Excel Course with AI Integration builds, and Lesson 148 even makes a habit of it: learners have Claude or ChatGPT draft pieces of the macro, each tool in its own window, then put right what comes back. Judging a draft takes what the lessons teach line by line: Lesson 145 reads a function a line at a time, Lesson 144 explains Option Explicit and declared variables, and Lesson 148 shows the classic slip of a message variable not emptied for each row, which lets one line's faults spill into the next. Debug.Print (Lesson 151) then proves which cells the draft reads before it writes anything. Describe your columns to the AI rather than pasting a real batch with bank details, test on a copy, and keep the final judgement for yourself: the code is only safe once you can explain every line of it.
Bank portal downloads, file clean-up and the checks before release: which of them belong to VBA?
The checks before release are VBA's, and The Complete Excel Course with AI Integration hands the other two to the tools built for them. Inside an open workbook VBA shines: formatting, looping through rows, flagging and colouring, which FormatWizard covers from Lesson 136. The recurring clean-up of a bank export suits Power Query, whose steps are saved and replayed on every refresh, taught in SalesFusion from Lesson 153. Clicking through a bank portal to fetch the files is work outside Excel, and Power Automate Desktop, which needs Windows, records desktop and browser actions into a flow in Lesson 181. VBA that downloads from a website is not taught; a treasury analyst who finishes the course holds all three tools, each placed where it is strongest, rather than one forced to do everything.
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 treasury
- XLOOKUP and VLOOKUP for treasury
- Pivot tables for treasury
- Excel charts for treasury
- Excel dashboards for treasury
- Conditional formatting for treasury
- Data cleaning for treasury
- Data validation for treasury
- Excel tables for treasury
- Text functions for treasury
- Date functions for treasury
- Dynamic arrays for treasury
- Power Query for treasury
- Power Pivot and DAX for treasury
- Power Automate for treasury
- Copilot in Excel for treasury
- ChatGPT for Excel for treasury
- Claude in Excel for treasury
Macros and VBA for other jobs
- Macros and VBA for controllers
- Macros and VBA for credit controllers
- Macros and VBA for AP clerks
- Macros and VBA for financial planners
- Macros and VBA for credit analysts
- Macros and VBA for underwriters
- Macros and VBA for claims handlers
- Macros and VBA for reconciliations
- Macros and VBA for every job