Join Curt Frye for an in-depth discussion in this video Verifying output using the Immediate window, part of Up and Running with VBA in Excel.
So far in this course, I verified my code's output using message boxes.…Message boxes are fine, but they require that the user, probably you, click a…button to dismiss them and continue running the program.…If you would prefer to bypass message boxes and still get feedback on your code,…you can use the Immediate window.…The Immediate window is a panel that appears at the bottom of the Visual Basic Editor.…So I'll press Alt+F11 to go there now.…To display the Immediate window, if you don't see it, you can either click View >…Immediate window, or press Ctrl+G. If you want to hide the Immediate window, you…can click its Close button, and I'll press Ctrl+G to bring it back.…
You can display the value currently assigned to a variable in the Immediate…window by typing a question mark followed by the variable name.…For example, let's suppose that I run this subroutine, but have a break before…it executes the line that assigns a value to the City variable.…If I press F5, it runs to that point.…Now, if I go to the Immediate window and type ?strState, you see New York.…
- Working in the Visual Basic Editor
- Adding code to a macro
- Creating, exporting, and deleting code modules
- Declaring and using variables
- Managing variable scope
- Defining arrays
- Managing workbooks and worksheets with VBA
- Repeating tasks with loops
- Debugging VBA code
- Cutting, copying, and pasting cell data
- Running and triggering event procedures
Skill Level Advanced
1. Introducing Visual Basic for Applications (VBA)
2. Defining Variables, Constants, and Calculations
3. Adding Logic to Your VBA Code
4. Debugging Your VBA Code
5. Managing Workbook Elements and Data in VBA
6. Adding Advanced Elements to Your Workbook
7. Using Excel Events in Your VBA Code
8. Putting It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.