PC Review


Reply
Thread Tools Rate Thread

How to change process bar % when macro is running

 
 
Alex St-Pierre
Guest
Posts: n/a
 
      12th Mar 2008
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro process running in task manager after the job is done Phillip Microsoft Access 3 4th Jan 2008 08:00 AM
macro process running in task manager after the job is done Phillip Microsoft Access 0 2nd Jan 2008 04:01 PM
another macro is running ... how to recognise that process in code??? Matthew Dodds Microsoft Excel Programming 7 24th Apr 2007 04:35 AM
RE: Running a macro on cell value change =?Utf-8?B?TWlrZQ==?= Microsoft Excel Misc 0 28th Mar 2007 01:13 AM
How to change a macro while running others? =?Utf-8?B?TUpP?= Microsoft Excel Programming 4 22nd Apr 2005 06:51 PM


Features
 

Advertising
 

Newsgroups
 


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