Who it's for: Business Analysts, Data Scientists, and everyone in between looking to write their own rulebook on what’s possible in Excel.
What it is: Visual Basic for Applications (VBA) is the programming language for Excel and other Microsoft Office programs. VBA is used to automate repetitive processes and frequent actions. Even more, it can be used to build tools that otherwise don’t exist in Excel.
What you'll learn: In this 4-part series, we start with the basics, giving you an overview of what you can do with VBA and its advantages over recording macros in the Excel interface. We'll record a macro, which produces VBA code in the background, and learn the Visual Basic editor environment before editing the code generated by our macro. Throughout this section, you will learn some key terminology that will help you along the way. We will end the first lesson by learning how to save a macro-enabled workbook and modify trust center settings pertaining to macro security. We will then move on to understanding the Excel Object Model, collections, and how to reference objects in VBA code. Once those basics are covered, you will be ready to move on to learning about the different types of procedures, creating procedures, learning the scope of procedures, and working with methods. You will also learn how to get VBA context-specific help from within the editor. A key component of VBA is language elements. We will learn about this important topic by going over variables, their scope, and how to declare them. You will also gain an understanding of VBA data types, intrinsic functions, and the With-End With structure and how it provides efficiency in your code. You will also learn to create message boxes and input boxes in this lesson, as well as gain an understanding of object variables. The next lesson will teach you how to control program flow through supported control-of-flow structures. This lesson begins with an overview of structures and Boolean expressions. You will then learn how to utilize conditional branching, with the lesson ending with looping constructs. We move into creating a form and programming its controls. During this lesson, you will learn about form properties, events, and methods, and learn how to add controls to the form and modify control properties. You will ultimately launch a form with code. The next lesson will take you through the steps necessary to create a Pivot Table programmatically in VBA. The series ends with you learning how to deal with code errors (debugging) and how to write error-handling code. By the end of this training series, you will be equipped with the basics to start writing your own VBA code, modify macros you’ve recorded, and have an understanding of how VBA lends itself to creating efficiency in your daily tasks.
- Introduction (1:56)
- VBA Basics (1:57)
- Getting Started (1:20)
- Example of Object-Oriented Programming Using Excel (1:02)
- Why VBA (0:41)
- VBA vs Macros (1:32)
- Adding the Developer Tab to the Ribbon (1:41)
- Filling in the Record Macro Dialog (3:06)
- Recording Macros (2:53)
- Testing Macros (1:29)
- Exploring VBE (3:22)
- Viewing VBE Options and Reviewing Macro Code (6:54)
- Editing Macro Code and Using Project Explorer and Properties (4:49)
- Adding Useful Commands to the Toolbar (3:02)
- Saving Macro-Enabled Workbooks (3:04)
- Testing Edited Macros (2:53)
- Reviewing and Changing Security Settings (4:30)
- VBA Basics Recap (1:31)
- Excel Object Model Hierarchy and Collections (4:42)
- Referencing Objects and Simplifying Object References (6:12)
- Introduction to Modules and Procedures (1:04)
- Understanding Modules (2:03)
- Understanding Procedures (4:48)
- Recording More Macros (4:22)
- Creating Sub-Procedures from the Menu in VBE (5:45)
- Reviewing New Code and Editing Existing Code (4:26)
- Creating Calling Procedures (3:40)
- Testing Calling Procedures (1:14)
- Creating Event Procedures (5:01)
- Creating Function Procedures (6:19)
- Reviewing and Testing Function Procedures (5:05)
- Getting Context Sensitive Help in VBE (3:22)
- Modules and Procedures Recap (1:28)
- Conclusion (0:09)