How to step through code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Quick question,
I have seen this solution noted many times, but how do I do this? I assume
it also works on code in an event (like ONCLICK).

Set a breakpoint on the Function "something". When you step
through the code line by line, does it work as you'd expect?

My method is to put msgbox "Step1" everywhere.
 
Set a breakpoint on the first line of the code procedure. Then step through
the code using the F8 key.
 
Quick question,
I have seen this solution noted many times, but how do I do this? I assume
it also works on code in an event (like ONCLICK).

Set a breakpoint on the Function "something". When you step
through the code line by line, does it work as you'd expect?

My method is to put msgbox "Step1" everywhere.

eeep!

MUCH harder than needed - you don't need to edit your code at all.

Open the VBA editor; edit the routine you wish to debug. With the
mouse, click in the vertical bar (looks like a scrollbar but isn't) on
the left side of the edit window. You'll get a red-brown circular dot
as a breakpoint.

When you run the code you can use the Debug... menu options to step
through - or (of course) their keyboard shortcuts. F8 singlesteps; see
the Debug dropdown for the other options.

John W. Vinson[MVP]
 
Back
Top