Building Your First VBA Module
Visual Basic for Applications and Excel. What a combination! They can do lots of magical things, but just writing VBA code isn’t enough; you need to write efficient code. VBA modules help you do that, and this course will teach you how to use them!
What you'll learn
There are lots of Excel VBA developers out there, and they’re all creating great Excel applications, but are they all structuring their code correctly? If you want to know about good code structure and how to make your code more reusable, this is the course to watch! In this course, Building Your First VBA Module, you'll use a pre-built application to learn about the three types of module VBA supports – Standard, Object, and Class. First, you’ll learn about the differences between them and when you might use each type of module. Next, the course takes a deep dive into class modules, outlining how to design and build a class module, how to use module events, and how to expose properties with getters, setters, and letters. You’ll also see how to test your code and how to extend your class module’s capabilities with external references. Finally, once you know how to build class modules, the course shows you how to use them, integrating the class module with a user form to build a completely custom user interface. You’ll find out how to add controls to user forms, as well as how to manipulate them via VBA. When you're finished with this course, you'll be able to take your VBA skills to the next level! Software required: Microsoft Excel, SQL Server Express, SQL Server Management Studio.
Table of contents
- Introduction 1m
- Designing a Class Module 3m
- Adding a New Class Module 3m
- Public Variables 4m
- Getters, Letters, and Setters 4m
- Creating a Property with Get and Let 4m
- Creating a Property with Get and Set 3m
- Adding a Data Source 4m
- Class Module Methods: Executing a Search 5m
- Testing a Method 3m
- Processing Selections 4m
- Further Method Testing 6m
- Class Module Events 3m
- Introducing Regular Expressions 2m
- Adding External References 6m
- Summary 2m