VBA is how you make Excel do the repetitive work for you. In 18 short chapters you go from recording a macro to writing your own procedures, loops, functions and a database connection, with copy-and-paste code in every lesson.
What you will learn
Foundations
The VBA editor, macro recording, variables, data types, comments, message and input boxes.
Logic and loops
If Then Else, Select Case, For, For Each, Do While and Do Until loops.
Working with Excel objects
Workbooks, worksheets, cells and ranges, formatting, copy and paste, sort and filter from code.
Professional touches
Worksheet functions in VBA, user-defined functions, error handling and ADODB connections to Access and SQL.
Course curriculum
-
Introduction to VBAWhat VBA is, enabling the Developer tab, and a tour of the Visual Basic Editor.
-
Macro RecordingRecord, run and read your first macro; absolute versus relative recording.
-
Variables and Data TypesDim, Integer, Long, String, Double, Boolean, Date and Variant.
-
CommentsDocumenting code so you and others can maintain it.
-
Input Box and Message BoxTalking to the user: prompts, buttons and return values.
-
If Then ElseDecisions in code, nested conditions and ElseIf.
-
Select CaseCleaner branching when there are many possible values.
-
WorkbooksOpen, save, close and switch between workbooks.
-
WorksheetsAdd, rename, hide, copy and loop through sheets.
-
Cells and RangeReading and writing cells, ranges, last row and last column.
-
FormattingFonts, fills, borders and number formats from code.
-
Cut, Copy and PasteMoving data between ranges, sheets and workbooks, including PasteSpecial.
-
Sort and FilterSorting ranges and applying AutoFilter with VBA.
-
Loops in VBAFor Next, For Each, Do While, Do Until and when to use each.
-
VBA and Worksheet FunctionsUsing VLOOKUP, SUMIF, COUNTIF and other Excel functions inside code.
-
User Defined FunctionsWrite your own worksheet functions with Function procedures.
-
Error HandlingOn Error GoTo, Resume, Err.Number and building macros that fail gracefully.
-
ADODB ConnectionRead and write Access or SQL Server data from Excel with ADO.
Who this course is for
Excel users who repeat the same steps every day, analysts who want to automate reports, and anyone who wants to build tools such as data entry forms, inventory systems or attendance trackers. You do not need any programming background. Comfort with formulas and the Excel functions library helps from chapter 15 onward.
Ready-made VBA systems you can use today
Inventory, hospital, dental clinic, GST billing, attendance and 190+ other VBA management systems are available on NextGenTemplates with full source code, so you can learn from working projects.
Frequently asked questions
Does VBA work in Excel for Mac and Excel Online?
VBA runs in Excel for Windows and Excel for Mac (with a few limitations, for example ADODB). Excel Online cannot run macros.
Do I need to enable anything?
Yes: turn on the Developer tab and save files as .xlsm. Chapter 1 shows both steps.
Is VBA still worth learning in 2026?
Yes. Office Scripts and Python in Excel are newer, but VBA remains the only option for user forms, desktop automation and the hundreds of thousands of existing workbooks that businesses still run on.