ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to stop VBA in a Loop (https://www.excelbanter.com/excel-programming/392355-how-stop-vba-loop.html)

[email protected]

How to stop VBA in a Loop
 
2003/2007


I realize that the info provided below is vague. Hitting the ESC key does not stop execution.

The loop is to cycle through a range of cells. As each new cell is accessed the loop causes
movement to/from other sheets to collect/parse data.

Therefore, there is much disk accessing and processor usage. Because of this, (I guess) the
keyboard is given low priority.

Bottom line, I would like to break execution to ascertain the area of the Loop.

The only success I have had is Ctrl-Alt-Delete to get Task Manager and then force Excel down.

Any thoughts appreciated,

EagleOne

David McRitchie

How to stop VBA in a Loop
 
I don't really have much on debugging but what I have is at
http://www.mvps.org/dmcritchie/excel...d.htm#problems

Here is Chip Pearson's page
VBA Debugging
http://www.cpearson.com/excel/Debug.htm

--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

wrote in message ...
2003/2007


I realize that the info provided below is vague. Hitting the ESC key does not stop execution.

The loop is to cycle through a range of cells. As each new cell is accessed the loop causes
movement to/from other sheets to collect/parse data.

Therefore, there is much disk accessing and processor usage. Because of this, (I guess) the
keyboard is given low priority.

Bottom line, I would like to break execution to ascertain the area of the Loop.

The only success I have had is Ctrl-Alt-Delete to get Task Manager and then force Excel down.

Any thoughts appreciated,

EagleOne





[email protected]

How to stop VBA in a Loop
 
I'll look at your site in the morning. Thanks Dave.

"David McRitchie" wrote:

I don't really have much on debugging but what I have is at
http://www.mvps.org/dmcritchie/excel...d.htm#problems

Here is Chip Pearson's page
VBA Debugging
http://www.cpearson.com/excel/Debug.htm


blackbox via OfficeKB.com

How to stop VBA in a Loop
 
Hit ESC twice to interrupt the code and get the End or Debug pop up

wrote:
I'll look at your site in the morning. Thanks Dave.

I don't really have much on debugging but what I have is at
http://www.mvps.org/dmcritchie/excel...d.htm#problems

Here is Chip Pearson's page
VBA Debugging
http://www.cpearson.com/excel/Debug.htm


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200706/1


Shiva Kumar

How to stop VBA in a Loop
 
Hello EagleOn,

Sorry to Inturrupt. As per your below message, if we follow we may loose changes made by us in the code.

So, it's better to use Ctrl+Pause Break. If we use this the changes made by us will be safe and stop's the loop.

Shiva.



On Thursday, June 28, 2007 9:35 PM EagleOn wrote:


2003/2007


I realize that the info provided below is vague. Hitting the ESC key does not stop execution.

The loop is to cycle through a range of cells. As each new cell is accessed the loop causes
movement to/from other sheets to collect/parse data.

Therefore, there is much disk accessing and processor usage. Because of this, (I guess) the
keyboard is given low priority.

Bottom line, I would like to break execution to ascertain the area of the Loop.

The only success I have had is Ctrl-Alt-Delete to get Task Manager and then force Excel down.

Any thoughts appreciated,

EagleOne



On Thursday, June 28, 2007 9:53 PM David McRitchie wrote:


I don't really have much on debugging but what I have is at
http://www.mvps.org/dmcritchie/excel...d.htm#problems

Here is Chip Pearson's page
VBA Debugging
http://www.cpearson.com/excel/Debug.htm

--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

wrote in message ...



Submitted via EggHeadCafe
Custom task processes in SharePoint Designer Workflows
http://www.eggheadcafe.com/tutorials...workflows.aspx


Mikec007

How to stop VBA in a Loop
 
Why not code your loop to stop when it reaches the end??

If you are going through a range of cells, find the last row in the
range, and tell the loop next until finalrow.


On 2010-11-22 08:40:52 -0500, Shiva Kumar said:

Hello EagleOn,

Sorry to Inturrupt. As per your below message, if we follow we may
loose changes made by us in the code.

So, it's better to use Ctrl+Pause Break. If we use this the changes
made by us will be safe and stop's the loop.

Shiva.



On Thursday, June 28, 2007 9:35 PM EagleOn wrote:


2003/2007


I realize that the info provided below is vague. Hitting the ESC key
does not stop execution.

The loop is to cycle through a range of cells. As each new cell is
accessed the loop causes
movement to/from other sheets to collect/parse data.

Therefore, there is much disk accessing and processor usage. Because
of this, (I guess) the
keyboard is given low priority.

Bottom line, I would like to break execution to ascertain the area of the Loop.

The only success I have had is Ctrl-Alt-Delete to get Task Manager and
then force Excel down.

Any thoughts appreciated,

EagleOne



On Thursday, June 28, 2007 9:53 PM David McRitchie wrote:


I don't really have much on debugging but what I have is at
http://www.mvps.org/dmcritchie/excel...d.htm#problems

Here is Chip Pearson's page
VBA Debugging
http://www.cpearson.com/excel/Debug.htm

--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

wrote in message
...



Submitted via EggHeadCafe
Custom task processes in SharePoint Designer Workflows
http://www.eggheadcafe.com/tutorials...workflows.aspx






Walter Briscoe

How to stop VBA in a Loop
 
In message of Mon, 22 Nov
2010 09:28:25 in microsoft.public.excel.programming, Mikec007
writes
Why not code your loop to stop when it reaches the end??

If you are going through a range of cells, find the last row in the
range, and tell the loop next until finalrow.


On 2010-11-22 08:40:52 -0500, Shiva Kumar said:

Hello EagleOn,
Sorry to Inturrupt. As per your below message, if we follow we may
loose changes made by us in the code.
So, it's better to use Ctrl+Pause Break. If we use this the changes
made by us will be safe and stop's the loop.
Shiva.

On Thursday, June 28, 2007 9:35 PM EagleOn wrote:


2003/2007
I realize that the info provided below is vague. Hitting the ESC
key does not stop execution.


I assume you want to interrupt execution, rather than merely stop -
usually because you have started something you have decided is
unprofitable.

The DoEvents Function yields execution so that the operating system can
process other events.

I am suspicious that it does not always work.
I wait for Internet Explorer to complete with
Do Until Not IE.busy And IE.ReadyState = 4: DoEvents: Loop

The loop is to cycle through a range of cells. As each new cell is
accessed the loop causes
movement to/from other sheets to collect/parse data.
Therefore, there is much disk accessing and processor usage.
Because of this, (I guess) the
keyboard is given low priority.
Bottom line, I would like to break execution to ascertain the area
of the Loop.
The only success I have had is Ctrl-Alt-Delete to get Task Manager
and then force Excel down.
Any thoughts appreciated,


I would put DoEvents into your loop at a point where the data is
consistent.

Powering down can also be effective at the cost of risking inconsistent
data.

You may later want to look at Application.OnTime; I don't think it will
help.

EagleOne


On Thursday, June 28, 2007 9:53 PM David McRitchie wrote:


I don't really have much on debugging but what I have is at
http://www.mvps.org/dmcritchie/excel...d.htm#problems
Here is Chip Pearson's page
VBA Debugging
http://www.cpearson.com/excel/Debug.htm
-- HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
wrote in message news:5sn883
...


Submitted via EggHeadCafe Custom task processes in SharePoint
Designer Workflows
http://www.eggheadcafe.com/tutorials...cc00-4fa0-b98b
-2e9ea9a559dd/custom-task-processes-in-sharepoint-designer-
workflows.aspx






--
Walter Briscoe


All times are GMT +1. The time now is 06:22 AM.

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