ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to "step into" in the middle of a long piece of code (https://www.excelbanter.com/excel-programming/407568-how-step-into-middle-long-piece-code.html)

stevec

How to "step into" in the middle of a long piece of code
 
Hi,

Currently I press F8 to step into a code. Then I have to select a yellow
arrow and drag it down to where I want to start viewing the code, step by
step.

Is there an easier way to step into exactly where you want to, instead of
dragging the arrow down? Like a "step into" at the cursor, option?

thanks...

DownThePaint

How to "step into" in the middle of a long piece of code
 
Hi SteveC

You can use the goto call, something like this

At the first line of code put in GoTo SteveCLine

Then at the place you want it to jump to type in SteveCLine:

When your through debuggin remove the lines

"SteveC" wrote:

Hi,

Currently I press F8 to step into a code. Then I have to select a yellow
arrow and drag it down to where I want to start viewing the code, step by
step.

Is there an easier way to step into exactly where you want to, instead of
dragging the arrow down? Like a "step into" at the cursor, option?

thanks...


Jim Thomlinson

How to "step into" in the middle of a long piece of code
 
There are a couple of options...

Ctrl + F8 is run to cursor
F9 adds a break point where code execution will pause
Click on the grey bar beside th line of code is another way to add a break
point.
--
HTH...

Jim Thomlinson


"SteveC" wrote:

Hi,

Currently I press F8 to step into a code. Then I have to select a yellow
arrow and drag it down to where I want to start viewing the code, step by
step.

Is there an easier way to step into exactly where you want to, instead of
dragging the arrow down? Like a "step into" at the cursor, option?

thanks...


Dana DeLouis

How to "step into" in the middle of a long piece of code
 
Is there an easier way to step into exactly where you want to, instead of
dragging the arrow down? Like a "step into" at the cursor, option?


Two options that come to mind are selecting your line of code and hit F9 to
set a breakpoint.
(another option later is to click the red dot to toggle on/off)

Another is to start with F8 as you are doing, then Right Click the code of
interest, and select "Run to Cursor."

--
HTH :)
Dana DeLouis


"SteveC" wrote in message
...
Hi,

Currently I press F8 to step into a code. Then I have to select a yellow
arrow and drag it down to where I want to start viewing the code, step by
step.

Is there an easier way to step into exactly where you want to, instead of
dragging the arrow down? Like a "step into" at the cursor, option?

thanks...





All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com