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:48)
- Variables, Data Types, and Intrinsic Functions (2:17)
- Introduction to Variables (5:21)
- Reviewing Project Explorer and Creating New Modules (2:51)
- Creating Sub-Procedures and Declaring Procedure Level Variables (3:10)
- Intrinsic Functions (2:31)
- Assigning Values to Variables Using Intrinsic Functions (7:43)
- With-End With Structure and Offset Property (3:13)
- Assigning Variable Values Using With-End With Structure (2:15)
- Testing ParseVIN Procedures (0:50)
- Message Boxes (4:36)
- Input Boxes (0:47)
- Creating and Testing Message Boxes in Event Procedures (6:39)
- Creating Input Boxes by Modifying Existing Procedures (7:44)
- Testing Modified Procedures (0:59)
- Introduction to Object Variables (1:14)
- Declaring Object Variables in Sub-Procedures (9:06)
- Testing Object Variables by Stepping Into Code (5:21)
- Variables, Data Types, and Intrinsic Functions Recap (2:00)
- Controlling Program Execution (0:58)
- Control Structures and Conditional Branching (7:55)
- If-Then-End If Construct (3:34)
- If-Then-Else-End If Construct (7:26)
- Rearranging Code and Creating Function Procedures (6:12)
- Testing Rearranged Code and Function Procedures (0:38)
- Setting With-End With Structure in Calling Procedures (7:19)
- Select Case and End Select Construct (0:39)
- Select Case Statement (3:00)
- Creating Function Procedures with Select Case Construct (2:16)
- Using Text Files to Insert Function Procedures (3:17)
- Looping Constructs - Do Loops (2:16)
- Modifying Procedures to Include Do While Loops (3:21)
- Sub-Procedure to Select, Cut, and Paste to Other Sheets (3:54)
- Creating Procedures to Clear Sheets and Call Procedures (3:35)
- Looping Constructs - For Loops (0:48)
- For To Next Loop and Encountering Errors (2:46)
- Investigating Cause of Error and Fixing It (5:39)
- Creating and Testing For Each Next Loop (3:24)
- Controlling Program Execution Recap (0:49)
- Conclusion (0:09)