Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Run time - % complete

Hi. I have a procedure that takes about 3 minutes to run on my machine, but
takes about 5 minutes on a "standard issue" machine. The code loops through
10 sheets. Is there a way to incorporate code that provides the end user
with a % complete indicator? Something (maybe a modeless message box, or in
the status indicator bar) that would update after each sheet loop in
increments of 10% (simple math for 10 sheets). Thanks! My code looks like
this:

Set shtarray = Sheets(Array("Sheet1", "Sheet1",....., "Sheet10"))

For Each sh In shtarray

With sh
x = .Cells(Rows.Count, "B").End(xlUp).Row
..Rows(2).Copy .Rows("5:" & x)
End With

Next


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Run time - % complete

Yeah, just add a counter...

Dim cnt as Long
Dim cntTotal as Long

cntTotal = 10

For Each sh In shtarray

With sh
cnt = cnt + 1
Application.StatusBar = Format(cnt/cntTotal,"Percent") & " Complete"
x = .Cells(Rows.Count, "B").End(xlUp).Row
..Rows(2).Copy .Rows("5:" & x)
End With

Next

"Steph" wrote:

Hi. I have a procedure that takes about 3 minutes to run on my machine, but
takes about 5 minutes on a "standard issue" machine. The code loops through
10 sheets. Is there a way to incorporate code that provides the end user
with a % complete indicator? Something (maybe a modeless message box, or in
the status indicator bar) that would update after each sheet loop in
increments of 10% (simple math for 10 sheets). Thanks! My code looks like
this:

Set shtarray = Sheets(Array("Sheet1", "Sheet1",....., "Sheet10"))

For Each sh In shtarray

With sh
x = .Cells(Rows.Count, "B").End(xlUp).Row
..Rows(2).Copy .Rows("5:" & x)
End With

Next



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default Run time - % complete

Steph

Here's some links to fancy progress bars (at the end)

http://www.dicks-blog.com/excel/2004...gress_bar.html

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Steph" wrote in message
...
Hi. I have a procedure that takes about 3 minutes to run on my machine,

but
takes about 5 minutes on a "standard issue" machine. The code loops

through
10 sheets. Is there a way to incorporate code that provides the end user
with a % complete indicator? Something (maybe a modeless message box, or

in
the status indicator bar) that would update after each sheet loop in
increments of 10% (simple math for 10 sheets). Thanks! My code looks

like
this:

Set shtarray = Sheets(Array("Sheet1", "Sheet1",....., "Sheet10"))

For Each sh In shtarray

With sh
x = .Cells(Rows.Count, "B").End(xlUp).Row
.Rows(2).Copy .Rows("5:" & x)
End With

Next




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Run time - % complete

I have some progress bar examples on my website.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Steph" wrote in message
...
Hi. I have a procedure that takes about 3 minutes to run on my machine,

but
takes about 5 minutes on a "standard issue" machine. The code loops

through
10 sheets. Is there a way to incorporate code that provides the end user
with a % complete indicator? Something (maybe a modeless message box, or

in
the status indicator bar) that would update after each sheet loop in
increments of 10% (simple math for 10 sheets). Thanks! My code looks

like
this:

Set shtarray = Sheets(Array("Sheet1", "Sheet1",....., "Sheet10"))

For Each sh In shtarray

With sh
x = .Cells(Rows.Count, "B").End(xlUp).Row
.Rows(2).Copy .Rows("5:" & x)
End With

Next




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
auto complete KCegbe Excel Worksheet Functions 1 May 28th 09 07:51 PM
Auto complete Ian Excel Worksheet Functions 0 February 19th 09 10:01 AM
How do I complete increments of time in column A by say 9 min? Sandiness Excel Discussion (Misc queries) 1 December 1st 08 06:02 AM
Subtotalling taking long time to complete AndyV Excel Worksheet Functions 4 July 14th 08 03:10 PM
Percent Complete? bassec Excel Discussion (Misc queries) 1 March 28th 06 08:11 AM


All times are GMT +1. The time now is 11:33 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"