🎉 Black Friday: 40% OFF every course with code BF40 · ends 1 Dec  See courses →
A new chapter in practical learning · Now enrolling: Advanced Excel & Power Query, Excel + AI Mastery, Excel Essentials in 2 Hours, Excel Pivot Tables & Dashboards, Excel VBA Advanced with AI, Excel VBA Basics with AI, Financial Modeling in Excel, Google Sheets Complete Course, Power BI and Project Management in ExcelView the courses ↗
EXCEL VBA

Excel VBA Advanced with AI

Go from macros that work to VBA that is fast, safe and professional: functions and UDFs, arrays and dictionaries, error handling, events, real UserForms, tables, pivots and charts by code, text files, class modules and clean structure - with AI as your pair programmer and every answer tested.

6h 28mAdvanced84 lessons
Created by Priyendra Kumar (PK) · NextGenTemplates Academy
Excel VBA Advanced with AI

What you’ll learn

  • Break long macros into small Subs and Functions with arguments, ByRef/ByVal and Optional parameters
  • Write your own worksheet functions (UDFs) with descriptions and share them as an add-in
  • Process 50,000 rows in seconds with arrays: read a range into memory, work there, write it back once
  • Use Collections and Scripting.Dictionary for unique lists, fast lookups and group totals without formulas
  • Handle errors like a professional: one clean pattern, an error log sheet, a text log and input validation
  • Make workbooks react with worksheet and workbook events, including a full audit trail of every change
  • Build real UserForms that add, validate, search, edit and delete records
  • Control Tables, filters, Find, sorting, pivot tables, slicers and charts entirely by code
  • Read and write text and CSV files, loop through folders and write OneDrive-safe file paths
  • Create class modules, speed up slow macros and structure, protect and distribute a project
  • Use AI as a pair programmer to refactor, review, test and document code - and prove every change with a test
  • Build a complete order review and data quality tool as your capstone project

A practical route to better work.

Your macros already work. This course makes them fast, safe and professional - the kind of VBA you can hand to a colleague, run on 50,000 rows in seconds and still understand six months later. You follow one fictional business, Copper Creek Home Goods, a home-goods wholesaler and online seller, and solve the problems real Excel developers meet every week: a 180-line macro nobody dares to touch, a loop that takes minutes, a data-entry sheet users keep breaking, daily CSV exports that pile up in a folder, and an 8,000-line order file full of hidden mistakes. Start by splitting long macros into small Subs and Functions with arguments, ByRef and ByVal, and write your own worksheet functions (UDFs) that you can share as an add-in. Learn the array rule that makes VBA fast - read a range into memory, work there, write it back once - and use Split, Join, Filter and dynamic array formulas from code. Use Collections and Scripting.Dictionary for unique lists, lookups and group totals without a single formula. Build error handling the way professionals do: one clean pattern, an error log sheet and a text log, and input checks before anything changes. Make workbooks react with worksheet and workbook events, including an audit trail that records every change with the old and new value. Design real UserForms: fill lists, add records, validate required fields, numbers and dates, and search, edit and delete records with a ListBox. Drive Excel Tables, AutoFilter, AdvancedFilter, Find, SpecialCells, sorting and duplicate removal by code, then create pivot tables, slicers and charts that rebuild themselves. Work with files and folders: FileDialog, Dir and FileSystemObject, reading and writing text and CSV files, and paths that keep working in OneDrive. Write your first class modules, speed up any macro with five settings and the array rule, and structure a project with clear naming, a config sheet and protection. In Module 12, AI becomes your pair programmer: refactor messy code safely, run an AI code review, generate test data and test cases, and document a project - and you prove every AI change with a test before you accept it. Every lesson has a practice workbook, the complete code as a .bas file and a finished solution. Eleven modules end with an assessment on a new business, a quiz and a full solution walkthrough. The capstone brings it all together: an order review and data quality tool that checks Copper Creek's October order file against nine rules, lists every problem, lets a reviewer fix or ignore each one in a UserForm, logs every action and builds a summary pivot and chart.

Frequently asked questions

Is this course for beginners?
No. It starts where Excel VBA Basics with AI ends. You should already write simple Subs, use variables, If and loops, and refer to ranges and sheets. If you are new to VBA, take Excel VBA Basics with AI first.

Which Excel version do I need?
Excel 365 or Excel 2021 on a Windows desktop PC. Excel 2019 and 2016 work for every lesson except the dynamic-array lesson 2.4. Mac, iPad and Excel for the web are not supported because UserForms, Dictionary and FileSystemObject are Windows desktop features.

Do I need a paid AI tool?
No. A free ChatGPT, Claude or Copilot account is enough for Module 12 and the AI Corners. You learn to test every AI answer, and you never paste real company data.

Will the code work in OneDrive and SharePoint folders?
Yes. The course uses only built-in VBA and Excel features, and lesson 9.4 shows file paths that keep working when a workbook is saved in OneDrive.

What do I get with each lesson?
A practice workbook to code in, the complete code as a .bas file you can import, a finished solution workbook and a PDF handout. Each module ends with an assessment on a new business, a quiz and a full solution walkthrough.

What will I build in the capstone?
An order review and data quality tool for an 8,000-line order file: it checks nine rules, lists every problem, lets a reviewer fix or ignore each one in a UserForm, logs every action and builds a summary pivot and chart.

Can I try it before I buy?
Yes. The welcome video 0.1 and lesson 1.1 (Sub vs Function and passing arguments) are free previews on the course page.

Inside the course

14 modules · 84 lessons
MODULE 01Start Here+
Welcome: from macro writer to VBA developer4 minPreview
Set up: course files, editor settings and code export habit5 min
MODULE 02Module 1: Procedures, Functions and Custom UDFs+
Sub vs Function and passing arguments8 minPreview
ByRef vs ByVal and Optional arguments7 min
Write your own worksheet functions (UDFs)8 min
Share UDFs: categories, descriptions and an add-in7 min
Module 1 assessment: Ridgeline Fitness Clubs memberships30 min
Module 1 quiz: check your understanding10 min
Module 1 solution walkthrough8 min
MODULE 03Module 2: Arrays+
Arrays basics: declare, fill and loop6 min
Range to array and back: the fast way to process 50,000 rows7 min
Split, Join, Filter and sorting an array6 min
Dynamic array formulas from VBA6 min
Module 2 assessment: Clearwater Utilities meter reads30 min
Module 2 quiz: check your understanding10 min
Module 2 solution walkthrough8 min
MODULE 04Module 3: Collections and Dictionaries+
Collections: lists you can grow6 min
Scripting.Dictionary: unique lists and lookups7 min
Group and total without formulas7 min
Module 3 assessment: Sunrise Pet Supply orders30 min
Module 3 quiz: check your understanding10 min
Module 3 solution walkthrough8 min
MODULE 05Module 4: Professional Error Handling+
Error-handling patterns that professionals use7 min
Write an error log sheet and a text log7 min
Validate inputs before changing anything6 min
Module 4 assessment: Ironwood Manufacturing batch log30 min
Module 4 quiz: check your understanding10 min
Module 4 solution walkthrough8 min
MODULE 06Module 5: Events+
Worksheet events: Change and SelectionChange7 min
More sheet events: BeforeDoubleClick, BeforeRightClick, Activate5 min
Workbook events: Open, BeforeSave, BeforeClose, SheetChange7 min
Audit trail: log every change with old and new values7 min
Module 5 assessment: Westfield Property Management rent roll30 min
Module 5 quiz: check your understanding10 min
Module 5 solution walkthrough9 min
MODULE 07Module 6: UserForms+
UserForm basics: controls, properties, Show and Unload8 min
Fill lists and add records7 min
Validate the form: required fields, numbers, dates7 min
Search, edit and delete records with a ListBox8 min
Make it look professional6 min
Module 6 assessment: Brightpath Tutoring enrolment form30 min
Module 6 quiz: check your understanding10 min
Module 6 solution walkthrough9 min
MODULE 08Module 7: Tables, Filters and Find by Code+
Tables (ListObjects) by code8 min
AutoFilter and AdvancedFilter7 min
Find, FindNext, Replace and SpecialCells5 min
Sort and remove duplicates by code5 min
Pattern checks with Like and text functions6 min
Module 7 assessment: Coastal Freight Lines loads30 min
Module 7 quiz: check your understanding10 min
Module 7 solution walkthrough8 min
MODULE 09Module 8: Pivot Tables and Charts by Code+
Create a pivot table by code7 min
Refresh, filter and slicers by code7 min
Charts by code: create, format and update6 min
Module 8 assessment: Golden Harvest Farms produce sales30 min
Module 8 quiz: check your understanding10 min
Module 8 solution walkthrough8 min
MODULE 10Module 9: Files, Folders and Text Files+
Pick files and folders: FileDialog6 min
Dir and FileSystemObject: list files and folders6 min
Read and write text and CSV files8 min
OneDrive-safe file paths7 min
Module 9 assessment: Summit Dental Group daily CSVs30 min
Module 9 quiz: check your understanding10 min
Module 9 solution walkthrough8 min
MODULE 11Module 10: Class Modules+
Why classes: your own object with properties and methods8 min
Collections of objects and a simple event class8 min
Module 10 assessment: Pioneer Auto Parts price rules30 min
Module 10 quiz: check your understanding10 min
Module 10 solution walkthrough8 min
MODULE 12Module 11: Speed, Structure and Distribution+
Speed: the 5 settings and the array rule7 min
Structure: naming, modules, config sheet, no magic numbers8 min
Protect and distribute: VBA password, sheet protection, versions6 min
Module 11 assessment: Silverline Staffing timesheets30 min
Module 11 quiz: check your understanding10 min
Module 11 solution walkthrough8 min
MODULE 13Module 12: AI as Your Pair Programmer+
Refactor messy code with AI - safely6 min
AI code review: find bugs before users do7 min
Generate test data and test cases with AI6 min
Document a project with AI: README, comments, user guide4 min
Module 12 quiz: AI as your pair programmer10 min
MODULE 14Module 13: Capstone - Order Review and Data Quality Tool+
Capstone brief: Copper Creek order review and data quality tool5 min
Capstone brief: build the order review and data quality tool15 min
Submit your capstone10 min
Capstone solution walkthrough19 min

Practice files

29 downloadable practice workbooks to follow along with the lessons.

Video lessons

59 step-by-step video lessons (6h 28m), streamed securely.

A practical assignment

Apply your learning, submit your work and explain your approach.

A knowledge check

Test your understanding with clear feedback and explanations.

Certificate of completion

Complete the course to download a certificate of completion with a unique certificate ID.

Is this course for you?

  • Analysts, accountants, MIS and operations staff whose macros work but are slow, fragile or hard to change
  • Learners who finished Excel VBA Basics with AI and want the professional next step
  • Excel power users who copy VBA from the web or from AI and want to understand, fix and trust it
  • Freelancers and in-house Excel developers who build tools, forms and reports for colleagues

Before you start

  • Excel VBA Basics with AI (the previous course in this series), or the same skills: record and run macros, write Subs with Option Explicit, use variables, If / Select Case and For / For Each / Do loops
  • Comfortable with Range, Cells, the last row, worksheets and workbooks in VBA, F8 stepping and basic On Error GoTo
  • Excel 365 or Excel 2021 on a Windows desktop PC (Excel 2019 and 2016 work for every lesson except dynamic arrays in 2.4)
  • Not for Mac, iPad or Excel for the web: UserForms, Scripting.Dictionary and FileSystemObject are Windows desktop features
  • Optional: a free ChatGPT, Claude or Copilot account for the AI lessons - you never paste real company data

About your instructor

Priyendra Kumar (PK), founder of NextGenTemplates

Priyendra Kumar (PK)

Founder, NextGenTemplates · Creator of PK: An Excel Expert

A business intelligence consultant, educator and template creator with more than 20 years of real-world experience in Excel, Power BI, Google Sheets, dashboards and business reporting.

PK has shared Excel tutorials on YouTube since 2017. In this course he teaches the same practical way: understand the idea, work through a business example, and build something you can use.

More about PK

Good to know

How do I buy a course, and which payment methods can I use?+

Choose a course, select Add to cart and complete checkout. With an Indian billing address you pay in INR through Razorpay, using UPI, cards or net banking. From any other country you pay in USD through PayPal, including debit and credit cards. It is a one-time payment, and the course appears in My Learning as soon as payment is confirmed.

Can I learn at my own pace?+

Yes. Lessons are organized into modules, and signed-in learners can save their progress and resume where they left off.

Are practice files included?+

Yes. Practice files are included with each paid course and can be downloaded from the course once you are enrolled. They are for your personal learning and your own internal work.

Will I receive a certificate?+

Yes. When you complete all required lessons (and any knowledge check or assignment in the course), you can download a certificate of completion with a unique certificate ID. It confirms course completion; it is not an academic or professional accreditation.

How long will I have course access?+

You get lifetime access: you can use the course for as long as NextGenTemplates Academy operates and offers it, as described in the Course Access Policy. There is no subscription or renewal fee.

Can I get a refund?+

Courses are digital content with immediate access, so purchases are generally non-refundable. Limited exceptions are explained in the Refund Policy.

FREE EXCEL LESSONS BY EMAIL

Not ready to enroll yet?

Join the Academy email list for practical Excel and AI tips, free preview lessons and news when a new course opens. Unsubscribe at any time.