Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a Drop Down List with Step by Step Instructions for 2007 | Excel Worksheet Functions | |||
Need step by step to add invoice numbering to excel template | New Users to Excel | |||
Excel 2000 Step By Step. What URL to use in Lesson 8? | New Users to Excel | |||
can't install CD from Excel 2003 step by step | New Users to Excel | |||
run macro step by step. excel 2003 | Excel Programming |