| Debugging using watches - Excel | | Print | |
You've just spent over an hour writing just the macro you need. It's the one that will make your life easier, and you just got it right—or so you thought. But now it's providing the wrong data output, and you can't figure out why. All the code looks right.
One of the great debug tools in the VBA Editor is called a watch expression. Watch expressions allow you to see the values of the variables in your macro at any given time. You can use them with the Step commands to walk though your code. These values can be a big help in finding out why your macro is generating the wrong data. You can use the watch expressions to see your variable values and then compare them to what they would be if your macro were working correctly.
To access the Watch window, just click View | Watch Window in the VBA Editor. To add a watch, right-click a variable and select Add Watch from the shortcut menu. This brings up a dialog box that gives you options about the new watch.
| Users' Comments (0) |
|
No comment posted






