Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default How to change process bar % when macro is running

Hi !
I have a userform2 that show a process bar. The program update the % only
when it begins to create a new table. Is there a way to have a progressive %
increase?

Example:
Table #1 takes 10 seconds to create (show 0% at beginning and 20% when
completed)
Table #2 takes 15 seconds to create (show 20% at beginning and 50% when
completed)
Table #3 takes 25 seconds to create (show 50% at beginning and 100% when
completed)

If the table#1 takes 12 seconds to create, it will increase 2% per second
until it reach 20%(no increment between 10 and 12 seconds). Thereafter, for
table #2, it will increase from 20% to 50% according the same increment (2%
per second). I'm wondering what is the best way to do that.

Is it to call a macro a lot of time in the program that calculate the time
and see if it should increase or not the %?

Thank's a lot!
Alex

For now, this is what I use:
Sub MainMacro
vPerc(1) = 0
vPerc(2) = 0.20
vPerc(3) = 0.50 'Cumulative
For i = 1 to 3
Call ProcessBar(vPerc(i),"Creating Table #" & i)
Call CreateMyTable(i)
Next i
End Sub
Sub ProcessBar(ProcessPerc As Variant, ProcessLabel As String)
With Userform2
.TextBox1.Text = ProcessLabel
.Caption = Format(ProcessPerc, "0%")
End With
End Sub


--
Alex St-Pierre
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
Excel Process Still Running DeveloperSQL Excel Programming 4 May 24th 07 06:00 PM
another macro is running ... how to recognise that process in code??? Matthew Dodds Excel Programming 6 April 24th 07 12:08 AM
How to Check if a Process is Running Chaplain Doug Excel Programming 0 May 24th 05 05:29 PM
How to count process running time ( process not finished) miao jie Excel Programming 0 January 13th 05 09:23 AM
How to count process running time ( process not finished) miao jie Excel Programming 2 January 12th 05 06:01 AM


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