ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Fill Label Text (https://www.excelbanter.com/excel-programming/295210-fill-label-text.html)

Andreas Szabo

Fill Label Text
 
Hi

during a process in excel, a progressbar advise the status of the process.
in a label, i want to display a text, which process is now active. There are
7 processes to display. Unfortunately, just the last process will be
displayed. It's now problem with a statusbar, but i'd like to display a
label. This is the code

lblProgressBar.Visible = True
ProgressBar1.Visible = True
ProgressBar1.Min = 0
ProgressBar1.Max = 300
ProgressBar1.Value = ProgressBar1.Min

For OutputZähler = 1 To GenerateOutput

Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.StatusBar = "Rechnet im Moment Simulation " &
OutputZähler
lblProgressBar.Caption = "Rechnet im Moment Simulation " &
OutputZähler
Application.ScreenUpdating = False

Call ExcelLesen
Call KonstantenFuellen
Call CalculateV
ROption = Log(1# + My(1))
Call HedgeCalculation
Call Cholesky
Call SimulProc

Next OutputZähler

ProgressBar1.Visible = False
lblProgressBar.Visible = False

Thanks for all your help.





Chris

Fill Label Text
 
If i understand what your asking, you want all 7 processes to show up in label but only the last one does
if so you need to use DoEvents after each change of the label text.

Vic Eldridge

Fill Label Text
 
If it were me, I'd use a Label from the Forms toolbar.

I'd update it's text like this,
ActiveSheet.Shapes("Label 1").TextFrame.Characters.Text = "Processing Part 3..."

And I'd follow that line immediately with the DoEvents function.


Regards,
Vic Eldridge


"Andreas Szabo" <Andreas.Szabo_PLEASE_INSERT_ADD_complementa.ch wrote in message ...
Hi

during a process in excel, a progressbar advise the status of the process.
in a label, i want to display a text, which process is now active. There are
7 processes to display. Unfortunately, just the last process will be
displayed. It's now problem with a statusbar, but i'd like to display a
label. This is the code

lblProgressBar.Visible = True
ProgressBar1.Visible = True
ProgressBar1.Min = 0
ProgressBar1.Max = 300
ProgressBar1.Value = ProgressBar1.Min

For OutputZähler = 1 To GenerateOutput

Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.StatusBar = "Rechnet im Moment Simulation " &
OutputZähler
lblProgressBar.Caption = "Rechnet im Moment Simulation " &
OutputZähler
Application.ScreenUpdating = False

Call ExcelLesen
Call KonstantenFuellen
Call CalculateV
ROption = Log(1# + My(1))
Call HedgeCalculation
Call Cholesky
Call SimulProc

Next OutputZähler

ProgressBar1.Visible = False
lblProgressBar.Visible = False

Thanks for all your help.



All times are GMT +1. The time now is 09:24 PM.

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