In the first section, we’ll be guiding you through the basics of how to create your first macro from scratch and read and write to cells. We’ll also cover different ways to run your macros, including making a cool looking button to trigger your macro.
- Intro and course workbooks download
- Get the developer tab and intro to developer tab
- Getting started with range object
- Quick tip – project explorer and properties window!
- Creating your first macro from scratch
- Adding a secondary command. . .
- Debugging in Excel VBA
- Saving a macro-enabled workbook (.xlsm)
- Before you begin the exercises
- Exercise 01 – Question
- Exercise 01 – Answer
- Several ways to trigger your macro
- Affecting multiple cells with one range command – 2 methods
- Adding strings of text to a cell
- Using a named range with the range object
- Range object quiz
Video: 1 hour & 15 minutes, 14 lectures
In the second section, we’ll go in-depth about all the properties and methods you need in order to manipulate one or more cells. You can change the font size, color, bold or italic, but also set formulas or format cells easily using VBA!
- .VALUE Property
- .TEXT Property
- .ROW and .COLUMN Properties
- .SELECT Property
- .COUNT Property
- Exercise 02a – Question
- Exercise 02a – Answer
- .ADDRESS Property
- .FORMULA Property
- .NUMBERFORMAT Property
- FONT.BOLD, UNDERLINE or ITALIC Properties
- Exercise 02b – Question
- Exercise 02b – Answer
Video: 53 minutes, 12 lectures
Section three explores the differences and similarities between accessing a cell through the Range object and the new Cells object, which can now access cells using row, column coordinates! This is useful when utilizing numeric loops and variables in the next sections.
- The cells object
- Using column letters instead of numbers
- Using cells positionally within a range
- Affecting all cells in a worksheet
- Exercise 03 – Question
- Exercise 03 – Answer
- Using range object with cells object
- Cells quiz
Video: 22 minutes, 8 lectures
Variables open up the possibilities in any programming language. You don’t have to store information in worksheet cells every time. Sometimes it’s better to store a date, string of text or even numbers inside of ‘nicknames’ called variables to contain or manipulate temporary data. They’re super fun and useful!
- Intro to variables
- Declaring variables – variable types
- Declaring variables – types of demo
- Concatenation – joining two or more strings!
- Bonus – date math fun!
- Exercise 04 – Question
- Exercise 04 – Answer
- Calling a procedure from another
- Public and private variables
- Using constants
- Bonus! Passing variables to another procedure – ByVal and ByRef
- Variables quiz
Video: 1 hour & 56 minutes, 19 lectures
You’re no better than your tools, so let’s take a look at the Visual Basic Editor and all the wonderful things you can do once you know how to use it!
- File menu walkthrough
- Edit menu walkthrough
- View menu walkthrough
- View menu2 – watch window, locals window and immediate window
- Watch window wonders!
- Insert and format menus
- Debug menu (important!)
- Run and tools menus
- Toolbars quiz
Video: 46 minutes, 6 lectures
This section covers all the tricks you’ll need to begin automating and really setting your programs in motion. Enjoy deliciously exciting experiments into IF/THEN statements, to create a fork in your procedures based on custom conditions. Learn how to determine the last row or column in order to set a cell section OR even to know which is the next row to automatically add new data to. That and much more!
- Determining the last row in your data set
- Determining the last column in your data set
- Determining the next row in your data set
- Recording a macro
- Bonus! – dynamic sorting!
- Absolute vs relative references
- Using with and end with
- Comparison operators in excel vba
- If then statement
- Using is not equal to (<>)
- Logical operator, not
- Exercise 06a – Question
- Exercise 06a – Answer
- If, then, else statement
- If, then, elseif statement. . .
- Comparative operators with text and numbers!
- Use if then statements in a one-liner of code
- Using go to and labels
- Select case as alternative to if then statements
- Message box with yes and no buttons
- Exercise 06b – Question
- Exercise 06b – Answer
- Relative positioning using offset
- Bonus – User defined functions 101
- Bonus – UDF lesson 2
- Super important info quiz
- Intro to loops; our for next loop
- Fun with our for next loop
- Beginning our first report using loops
- Using an inputbox
- Adding inputbox to our first report to make it dynamic
- Add a button to open our report
- Add a cool looking button or image to open report
- Our first printable report part 1 – declaring and setting the sheets
- Printable report part 2 – getting items on report sheet
- Printable report part 3 – clearing last report
- Printable report part 4 – ensuring visibility and autoselect report sheet
- Exercise 07a – Question
- Exercise 07a – Answer
- Using printpreview automatically
- Using printout to send directly to default printer
- Handling debug error when cancelling inputbox
- For loop going backwards using step
- The for each loop
- For each loop – practical examples
- Exercise 07b – Question
- Exercise 07b – Answer
- Intro to do loops
- Do until
- Loop until
- Do while
- Loop while
- Exit do – multiple exits using your own criteria along the way!
- Bonus – loop through multiple files in a folder and scrape data from each
- Loops and reports quiz
Video: 2 hours & 58 minutes, 28 lectures
- Intro to worksheet events and Selection_Change
- Worksheet activate event
- Worksheet deactivate event
- BeforeDelete event – for worksheet deletion
- BeforeDoubleClick event – trigger a macro when double clicking
- BeforeRightClick event – trigger a macro when right-clicking
- Calculate event
- Exercise 08a – Question
- Exercise 08a – Answer
- How to disable events on the workbook
- Intro to change event
- Change event with EnableEvents toggle – avoid endless loop!
- Change event triggered with custom range using intersect
- FollowHyperlinks event
- Final thoughts on worksheet events and review other events
- Exercise 08b – Question
- Exercise 08b – Answer
- Worksheet events quiz
Video: 1 hour & 59 minutes, 21 lectures
- Workbook open
- Workbook activate
- Before save
- After save
- Before close
- Before print
- Exercise 09 – Question
- Exercise 09 – Answer
- Sheet Activate
- Delete, DoubleClick, RightClick, Calculate, Change
- Follow hyperlink
Video: 1 hour & 25 minutes, 21 lectures
Adding CommandButtons, ComboBoxes (dropdown menus), ListBoxes, and many other ActiveX controls can really make your program POP! There’s a lot you can do with these, and each one has many, many triggers you can manipulate. Want to select ALL the text in a textbox when you click into it? Want to automatically Disable and gray out certain controls when conditions are met? Want to set up data entry and calculation on button click (but first to check a few conditions?).
Meet your new best friend. ActiveX Controls.
- Activex Controls vs Forms Controls
- Button Click – Wage Calculator
- Keydown Event
- BONUS: Capturing Shift, Alt, Ctrl or some combination using the Shift variable
- KeyPress event
- MouseMove event
- MouseMove event with Application.Statusbar – fun and useful
- MouseUp and MouseDown Events – Left, Middle, & Rightclick, Shift, Alt & Ctrl
- GotFocus and LostFocus events
- Use a Checkbox for its VALUE
- Checkbox event without a button
- LinkedCell property with a checkbox
- Option buttons intro – What is an option button and grouping
- Grouping, Alignment and Aesthetics for Controls
- Homemade quiz using option buttons and a command button
- Compliance checker for your Forms or Quizzes Part 1
- Compliance check part 2
- SpinButton with Cell A1
- SpinButtons with Textboxes and Numbers
- SpinButton BONUS – Move Textbox Position with SpinButton
- SpinButton with Dates in a Textbox
- Activex “Label” Control – Basics
- ComboBox – Fill with ListFillRange
- Creating a Dynamic Range
- ComboBox – How to use Multiple Columns
- Using .ADDITEM to Get Specific items in your Combobox List
- Noteworthy Properties of a Combobox
- Multiple Columns in Combobox with .ADDITEM and List, ListCount etc
- ListBox Basics using Dynamic Range
- Listbox Click event and Dynamic Options
- BONUS – Manipulating and using multiselect items in a Listbox
- ListBox – Referencing Column 0 and 1 in a cell Dynamically!
- Dynamic ListBoxes Using .ADDITEM and More
- Make and Utilize INVISIBLE Columns – Special Trick!
- Using a Scroll Bar on a worksheet
- Pictures on a Worksheet, plus using FollowHyperlink Method
- Toggle button
- A brief note on Alternate, 3rd Party Controls
Video: 7 hours & 6 minutes, 54 lectures
If it sounds like I’m enthusiastic, that’s because I AM! Userforms can take your program to the next level, giving you a new profound amount of control.
Did you know you can make a form popup that can call up other forms, control all procedures and bring up reports, all the while hosting lots of ActiveX controls that help you manage, manipulate, update or append new data. Keeping in mind, you can actually edit or add to sheets that are completely hidden to the end user! WHAT?! Yep. It’s amazing and so much fun.
- Userform – Hide, show and unload
- Sample database and creating a data entry form
- Fill Status combobox with Rowsource when Userform starts – 2 methods
- New employee data entry form!
- Format textbox numbers as numerals, clearing out form upon submission
- Set the tab order for userform controls
- Set default values to make data entry easier
- Avoid duplicate employee ID and other fun automation tricks
- Edit Mode for Employee Database – Part 1
- Edit Mode for Employee Database – Part 2
- Edit Mode Pt 3 – Adding Automation and Save Button
- BONUS – Refreshing the RowSource After Updating Data!
- BONUS – Combobox by Last Name Instead of EmpID
- BONUS – Search Name and ID
- Userform Report with Filters – Part 1
- Userform Report with Filters – Part 2
- Applying the Dynamic Filters to Reports
- Clear out Last Report
- Report generation and aesthetics, headers, footers, repeat rows etc.
- Advanced exercise – Review of Objectives
- Advanced exercise 01 – Solution
- Advanced exercise 02 – Solution
- Advanced exercise 03 and 04 – Solutions
- Advanced exercise BONUS A and B – Solutions
- Advanced exercise BONUS C automate the workflow for efficiency – Solutions
- Concluding thoughts. . .
Video: 8 hours & 46 minutes, 57 lectures
Here’s where I show you some additional features that are just amazing, but don’t always have a nice place to file away. Or I got asked a random question and it merited a video in the Bonus section. Fun!
- InStr Function – Search for Text Within Other Text
- The EVALUATE Function – Mac-Daddy of all functions
- Sum Function in Excel VBA – EASY!
- Count Function in VBA
- BONUS LECTURE
Video: 19 minutes, 5 lectures