#1   Report Post  
GWB Direct
 
Posts: n/a
Default Macros Pause

Is there a line of code that I can add to my macros that would pause between
each with or end with statment. I would like to view it slower than it works
right now.
--
Gary Baker
  #2   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Gary,

You can step it with F8 (in the VBE), and Alt-Tab back to Excel and watch
stuff happen. Or put Excel and the VBE in windows (unmaximized). Or you
can put a breakpoint (F9) on a line to stop it at selected places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Is there a line of code that I can add to my macros that would pause
between
each with or end with statment. I would like to view it slower than it
works
right now.
--
Gary Baker



  #3   Report Post  
GWB Direct
 
Posts: n/a
Default

Can I put a breakpoint in the code and watch it in excel after I hit the
button for the macro. I want to see visually what is happening but at a
slower pace. How do I put a breakpoint line in my macro and where do I put
it. Does it go before the With section or after the End With section.
--
Gary Baker


"Earl Kiosterud" wrote:

Gary,

You can step it with F8 (in the VBE), and Alt-Tab back to Excel and watch
stuff happen. Or put Excel and the VBE in windows (unmaximized). Or you
can put a breakpoint (F9) on a line to stop it at selected places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Is there a line of code that I can add to my macros that would pause
between
each with or end with statment. I would like to view it slower than it
works
right now.
--
Gary Baker




  #4   Report Post  
Nick Hodge
 
Posts: n/a
Default

Gary

F8 as outlined by Earl is debug mode, it steps a line at a time, allowing
you to check what's happening, check variable values, etc. (I use this one
mostly)

A 'breakpoint' will literally stop the code at a certain line, again so you
can check the state of the running code. From here you can either elect to
step (F8) or run the remaining code. I tend to use breakpoints more in
large code scenarios, when I now the first x lines work, to get to a
problematical bit quickly, or most of the time in event code, so I can then
step through (F8), after the event has fired. There is not a 'slow motion'
setting if that is what you are asking...stop or step, that's about it.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"GWB Direct" wrote in message
...
Can I put a breakpoint in the code and watch it in excel after I hit the
button for the macro. I want to see visually what is happening but at a
slower pace. How do I put a breakpoint line in my macro and where do I put
it. Does it go before the With section or after the End With section.
--
Gary Baker


"Earl Kiosterud" wrote:

Gary,

You can step it with F8 (in the VBE), and Alt-Tab back to Excel and watch
stuff happen. Or put Excel and the VBE in windows (unmaximized). Or you
can put a breakpoint (F9) on a line to stop it at selected places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Is there a line of code that I can add to my macros that would pause
between
each with or end with statment. I would like to view it slower than it
works
right now.
--
Gary Baker






  #5   Report Post  
Bill Martin -- (Remove NOSPAM from address)
 
Posts: n/a
Default

GWB Direct wrote:
Can I put a breakpoint in the code and watch it in excel after I hit the
button for the macro. I want to see visually what is happening but at a
slower pace. How do I put a breakpoint line in my macro and where do I put
it. Does it go before the With section or after the End With section.



What I typically do with stuff like that is just to put a MsgBox()
statement into the code temporarily. Works fine if you just have a
couple of places you want to monitor. It forces things to a halt while
it waits for you to click on a button to continue.

Good luck....

Bill


  #6   Report Post  
GWB Direct
 
Posts: n/a
Default

I understand how the step function work. I would like to watch the macro move
slower so I can film the steps to teach how a particular function works. This
would be similar to the SHOW Me function that some programs have. It shows
you each thing you click on and what it's doing as you go.
--
Gary Baker


"Nick Hodge" wrote:

Gary

F8 as outlined by Earl is debug mode, it steps a line at a time, allowing
you to check what's happening, check variable values, etc. (I use this one
mostly)

A 'breakpoint' will literally stop the code at a certain line, again so you
can check the state of the running code. From here you can either elect to
step (F8) or run the remaining code. I tend to use breakpoints more in
large code scenarios, when I now the first x lines work, to get to a
problematical bit quickly, or most of the time in event code, so I can then
step through (F8), after the event has fired. There is not a 'slow motion'
setting if that is what you are asking...stop or step, that's about it.

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"GWB Direct" wrote in message
...
Can I put a breakpoint in the code and watch it in excel after I hit the
button for the macro. I want to see visually what is happening but at a
slower pace. How do I put a breakpoint line in my macro and where do I put
it. Does it go before the With section or after the End With section.
--
Gary Baker


"Earl Kiosterud" wrote:

Gary,

You can step it with F8 (in the VBE), and Alt-Tab back to Excel and watch
stuff happen. Or put Excel and the VBE in windows (unmaximized). Or you
can put a breakpoint (F9) on a line to stop it at selected places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Is there a line of code that I can add to my macros that would pause
between
each with or end with statment. I would like to view it slower than it
works
right now.
--
Gary Baker






  #7   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

I think you'll have to forget the slow-motion. To set a breakpoint, put the
cursor on the line where you want it to break (pause execution). Press F9.
It will turn it red. Now when you run the macro, it will stop on that line,
highlighting it in yellow and bold text, not having executed it yet. From
that point, you can press F5 to continue at VBA's breakneck speed (which you
can almost watch anyway!), or F8 to step it. YOu can Alt-Tab back to Excel
at any time to see the effects on the sheets. Wherever it stops with a line
highlighted in yellow is a line that has not yet been executed. You can put
breakpoints in several places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Can I put a breakpoint in the code and watch it in excel after I hit the
button for the macro. I want to see visually what is happening but at a
slower pace. How do I put a breakpoint line in my macro and where do I put
it. Does it go before the With section or after the End With section.
--
Gary Baker


"Earl Kiosterud" wrote:

Gary,

You can step it with F8 (in the VBE), and Alt-Tab back to Excel and watch
stuff happen. Or put Excel and the VBE in windows (unmaximized). Or you
can put a breakpoint (F9) on a line to stop it at selected places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Is there a line of code that I can add to my macros that would pause
between
each with or end with statment. I would like to view it slower than it
works
right now.
--
Gary Baker






  #8   Report Post  
GWB Direct
 
Posts: n/a
Default

Thanks,
I may be able to use this option.
--
Gary Baker


"Earl Kiosterud" wrote:

I think you'll have to forget the slow-motion. To set a breakpoint, put the
cursor on the line where you want it to break (pause execution). Press F9.
It will turn it red. Now when you run the macro, it will stop on that line,
highlighting it in yellow and bold text, not having executed it yet. From
that point, you can press F5 to continue at VBA's breakneck speed (which you
can almost watch anyway!), or F8 to step it. YOu can Alt-Tab back to Excel
at any time to see the effects on the sheets. Wherever it stops with a line
highlighted in yellow is a line that has not yet been executed. You can put
breakpoints in several places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Can I put a breakpoint in the code and watch it in excel after I hit the
button for the macro. I want to see visually what is happening but at a
slower pace. How do I put a breakpoint line in my macro and where do I put
it. Does it go before the With section or after the End With section.
--
Gary Baker


"Earl Kiosterud" wrote:

Gary,

You can step it with F8 (in the VBE), and Alt-Tab back to Excel and watch
stuff happen. Or put Excel and the VBE in windows (unmaximized). Or you
can put a breakpoint (F9) on a line to stop it at selected places.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"GWB Direct" wrote in message
...
Is there a line of code that I can add to my macros that would pause
between
each with or end with statment. I would like to view it slower than it
works
right now.
--
Gary Baker






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
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 07:20 PM
Macros disappear after a file is imported Brent E Excel Discussion (Misc queries) 1 December 18th 04 12:25 AM


All times are GMT +1. The time now is 02:40 PM.

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"