ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Progress Bar (https://www.excelbanter.com/excel-programming/345172-progress-bar.html)

matpj[_21_]

Progress Bar
 

Hi there,

i would very much like to include a progress bar, or use the comman
bar status section to display how my macro is doing (so users do no
think the process has crashed)

I have several modules that are run, starting with Module1.

Does anyone have some plug and play code that I can simply copy an
paste, and just insert "Call openfobs()" into?

thanks in advance,
Mat

--
matp
-----------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...fo&userid=2107
View this thread: http://www.excelforum.com/showthread.php?threadid=48355


K Dales[_2_]

Progress Bar
 
The status bar can be written to as follows:

Application.StatusBar = "Please wait..."
When done set Application.Statusbar = False to give control back to Excel.

But there is no "plug and play" way to show how much progress you have made
since the status bar text has no way of knowing what your code is doing, or
how close to done it is, without being in some way linked to your code.
Normally, what takes code a long time to run is a loop; so you could update
the bar in your loop to show progress:

For i = 1 to 1000
' Your loop code
Application.StatusBar = "Please wait: " & Format(i/1000,"%##0") & "
complete"
Next i

But how to do this depends on what kind of loops you have in your code and
how you would "measure" progress.

There is also an ActiveX ProgressBar available in the "Other Controls" of
the control toolbox that can be used, but likewise needs to be linked to your
code.
--
- K Dales


"matpj" wrote:


Hi there,

i would very much like to include a progress bar, or use the command
bar status section to display how my macro is doing (so users do not
think the process has crashed)

I have several modules that are run, starting with Module1.

Does anyone have some plug and play code that I can simply copy and
paste, and just insert "Call openfobs()" into?

thanks in advance,
Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=483556



dominicb[_162_]

Progress Bar
 

Good afternoon Matpj

There are quite a few examples available, which provide "slot in" cod
to add to your project. Try these out :

http://www.cpearson.com/excel/Progress.htm
http://www.andypope.info/vba/pmeter.htm

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=48355



All times are GMT +1. The time now is 03:36 AM.

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