Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Excel VBA Step into

Hi

I have a large macro with 100's of lines of code, sometimes I need to run
half of the code. I stepin the macro then have to drag the yellow arrow
100's of lines down, Is the a way to start the code somewhere in the middle
without draging the arrow down all those lines. I've looked in Help &
Googled, Is there a way?

Thanks in advance

Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Excel VBA Step into

divide the code into 2 parts/macros

cut the lower/2nd part into another macro, name it "part2" for
instance

in the 1st macro instead of the code that had been cut put:

Call part2

this will keep your 1st macro unchanged


and use the "part2" macro when needed



HIH



On 23 Mar, 22:42, "DaveM" wrote:
Hi

I have a large macro with 100's of lines of code, sometimes I need to run
half of the code. I stepin the macro then have to drag the yellow arrow
100's of lines down, Is the a way to start the code somewhere in the middle
without draging the arrow down all those lines. I've looked in Help &
Googled, Is there a way?

Thanks in advance

Dave


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Excel VBA Step into

forgot to mention that your variables have to be made public
;-(
sorry


On 23 Mar, 23:00, Jarek Kujawa wrote:
divide the code into 2 parts/macros

cut the lower/2nd part into another macro, name it "part2" for
instance

in the 1st macro instead of the code that had been cut put:

Call part2

this will keep your 1st macro unchanged

and use the "part2" macro when needed

HIH

On 23 Mar, 22:42, "DaveM" wrote:



Hi


I have a large macro with 100's of lines of code, sometimes I need to run
half of the code. I stepin the macro then have to drag the yellow arrow
100's of lines down, Is the a way to start the code somewhere in the middle
without draging the arrow down all those lines. I've looked in Help &
Googled, Is there a way?


Thanks in advance


Dave- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Excel VBA Step into

Just a few thoughts...

Excel macros are sequential code. They have to execute in the sequence you
have set forth.

When I need to do what you are wanting to do, I single click the left pane
on the line of code just before the code line I want to step into. This
should put a maroon circle on the left side pane and highlight that line of
code in maroon as well. This sets a stop point for your macro. You can
launch the macro and it will stop at this point and wait for you to give it
further instructions (ie - continue to step through the remainder of your
code with "F8", or something like that).

Mark

"DaveM" wrote in message
...
Hi

I have a large macro with 100's of lines of code, sometimes I need to run
half of the code. I stepin the macro then have to drag the yellow arrow
100's of lines down, Is the a way to start the code somewhere in the
middle without draging the arrow down all those lines. I've looked in Help
& Googled, Is there a way?

Thanks in advance

Dave

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Excel VBA Step into

On Sun, 23 Mar 2008 17:50:20 -0500, "Mark Ivey"
wrote:

Just a few thoughts...

Excel macros are sequential code. They have to execute in the sequence you
have set forth.

When I need to do what you are wanting to do, I single click the left pane
on the line of code just before the code line I want to step into. This
should put a maroon circle on the left side pane and highlight that line of
code in maroon as well. This sets a stop point for your macro. You can
launch the macro and it will stop at this point and wait for you to give it
further instructions (ie - continue to step through the remainder of your
code with "F8", or something like that).


That's how I do it too. You can also scroll down to the line you want
(while in break mode), right click, and choose Run to Cursor.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Excel VBA Step into

You can also add a Stop statement in there, it will then wait for you, or
even add a conditional Debug.Assert, so many ways.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Dick Kusleika" wrote in message
...
On Sun, 23 Mar 2008 17:50:20 -0500, "Mark Ivey"
wrote:

Just a few thoughts...

Excel macros are sequential code. They have to execute in the sequence you
have set forth.

When I need to do what you are wanting to do, I single click the left pane
on the line of code just before the code line I want to step into. This
should put a maroon circle on the left side pane and highlight that line
of
code in maroon as well. This sets a stop point for your macro. You can
launch the macro and it will stop at this point and wait for you to give
it
further instructions (ie - continue to step through the remainder of your
code with "F8", or something like that).


That's how I do it too. You can also scroll down to the line you want
(while in break mode), right click, and choose Run to Cursor.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Excel VBA Step into

Thank you all very much for your Help.

All is fine

DaveM


"Bob Phillips" wrote in message
...
You can also add a Stop statement in there, it will then wait for you, or
even add a conditional Debug.Assert, so many ways.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Dick Kusleika" wrote in message
...
On Sun, 23 Mar 2008 17:50:20 -0500, "Mark Ivey"
wrote:

Just a few thoughts...

Excel macros are sequential code. They have to execute in the sequence
you
have set forth.

When I need to do what you are wanting to do, I single click the left
pane
on the line of code just before the code line I want to step into. This
should put a maroon circle on the left side pane and highlight that line
of
code in maroon as well. This sets a stop point for your macro. You can
launch the macro and it will stop at this point and wait for you to give
it
further instructions (ie - continue to step through the remainder of your
code with "F8", or something like that).


That's how I do it too. You can also scroll down to the line you want
(while in break mode), right click, and choose Run to Cursor.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Need step by step to add invoice numbering to excel template rmt New Users to Excel 4 July 6th 08 11:45 PM
Excel 2000 Step By Step. What URL to use in Lesson 8? dougcsdp New Users to Excel 4 March 4th 08 05:07 AM
can't install CD from Excel 2003 step by step djclark New Users to Excel 0 February 9th 06 11:31 PM
run macro step by step. excel 2003 PBM[_3_] Excel Programming 2 November 19th 05 02:19 PM


All times are GMT +1. The time now is 01:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"