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

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…

Contents