ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   visible counter (https://www.excelbanter.com/excel-programming/345507-visible-counter.html)

mike allen[_2_]

visible counter
 
I have a rather large loop (7,000+) that takes 4-5 minutes to run all the
way through. I would like to know my status in the loop as it progresses.
How do I get something like "2345 of 7000" to constantly show in the bottom
status bar (or elsewhere). I am assuming it will not slow the run time much
if at all. Thanks, Mike Allen



Norman Jones

visible counter
 
Hi Mike,

See John Walkenbach at:


http://www.j-walk.com/ss/excel/tips/tip34.htm


---
Regards,
Norman

"mike allen" wrote in message
...
I have a rather large loop (7,000+) that takes 4-5 minutes to run all the
way through. I would like to know my status in the loop as it progresses.
How do I get something like "2345 of 7000" to constantly show in the bottom
status bar (or elsewhere). I am assuming it will not slow the run time
much if at all. Thanks, Mike Allen




Tom Ogilvy

visible counter
 
for i = 1 to 7000
application.StatusBar = i & " of 7000"
Next

' return StatusBar to Excel
application.StatusBar = False

or

for i = 1 to 7000
if i mod 100 = 0 then
application.StatusBar = i & " of 7000"
end if
Next


--
Regards,
Tom Ogilvy

"mike allen" wrote in message
...
I have a rather large loop (7,000+) that takes 4-5 minutes to run all the
way through. I would like to know my status in the loop as it progresses.
How do I get something like "2345 of 7000" to constantly show in the

bottom
status bar (or elsewhere). I am assuming it will not slow the run time

much
if at all. Thanks, Mike Allen





grahammal[_8_]

visible counter
 

mike allen Wrote:
I have a rather large loop (7,000+) that takes 4-5 minutes to run all
the
way through. I would like to know my status in the loop as it
progresses.
How do I get something like "2345 of 7000" to constantly show in the
bottom
status bar (or elsewhere). I am assuming it will not slow the run time
much
if at all. Thanks, Mike Allen


Not sure what the loop is but if it's a FOR/NEXT loop then this would
do the trick.

For n = 1 To 7000
' Whatever your loop is doing
Sheets("Sheet1").Range("A1") = n
Next n

This will count up from 1 to 7000 in cell A1
I've used Sheet1 as the name for my worksheet, you would have to
substitute this for the name of your worksheet.


--
grahammal
------------------------------------------------------------------------
grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
View this thread: http://www.excelforum.com/showthread...hreadid=484750



All times are GMT +1. The time now is 04:25 PM.

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