From the course: Excel: Learning VBA
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Step through a subroutine or function - Microsoft Excel Tutorial
From the course: Excel: Learning VBA
Step through a subroutine or function
- [Instructor] Running a subroutine without stopping is one way to verify your work. But sometimes the only way to find an error or discover how an unfamiliar program works is to move through it one step at a time. As an example, we'll take this workbook where I'm tracking the amount of money that I owe to various taxing authorities. My sample file is 04_02_StepThrough and you can find it in the Chapter Four folder of the Exercise Files Collection. On the orders worksheet, I see that I owe $22,841 in the state of Virginia, to the city, actually town of Mount Crawford. I have created Excel VBA routines to display values from this dataset. And to demonstrate how to move through that process one step at a time, I'll press Alt + F11 to move to the Visual Basic Editor and you see here that I have three subroutines, Display Info, Display State, and Display City. At the top, I have declared several variables that can be…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Manage errors using On Error statements6m 8s
-
(Locked)
Step through a subroutine or function6m 2s
-
(Locked)
Set breakpoints in your code3m 47s
-
(Locked)
Verify output using the Immediate window5m 10s
-
(Locked)
Watch a value in a routine4m 10s
-
(Locked)
Challenge: Debug your VBA code3m 38s
-
(Locked)
Solution: Debug your VBA code4m 1s
-
(Locked)
-
-
-
-