Not able to integrate Progress bar vba with existing code

vineet78

Board Regular
Joined
Oct 22, 2017
Messages
74
Hi

I have a long vba code with almost 7 vba codes calling each other and i want to show the progress of vba to the user using progress bar. I have both the codes ie. for Progress bar and my own code but i am not able to integrate the both.

Please advise on how to integrate the bigger vba codes in progress bar code. Because so far i have very simple codes written in progress bar codes.

Regards
Vineet:eeek:
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi Vineet78,

Please see below how to integrate the progress bar into your code:


Sub Attente()
F_BarreAttente.Show ' draft a progress bar userform (see the link hereunder)
'==== traitement1
F_BarreAttente.Caption = "20%"
F_BarreAttente.Label1.Width = 20
DoEvents

call YourProcedure ' here -> paste the first code that VBA will execute, displaying the userform with 20% of progress


'==== traitement2
F_BarreAttente.Caption = "40%"
F_BarreAttente.Label1.Width = 40
DoEvents
call YourProcedure ' here -> paste the 2nd code that VBA will execute, displaying the userform with 40% of progress
'==== traitement3
F_BarreAttente.Caption = "60%"
F_BarreAttente.Label1.Width = 60
DoEvents
call YourProcedure ' here -> paste the 3Rd code that VBA will execute, displaying the userform with 60% of progress
'==== traitement4
F_BarreAttente.Caption = "80%"
F_BarreAttente.Label1.Width = 80
DoEvents
call YourProcedure ' here -> paste the 4th code that VBA will execute, displaying the userform with 80% of progress


Unload F_BarreAttente
End Sub



Please find into the following link the code and the userform displaying the progress bar:
http://boisgontierjacques.free.fr/pages_site/formulaireProgression.htm
Thank to Jacques Boisgontier for this tutorial.

Hope it helps,

Yaninja
 
Upvote 0
Hi Yaninja

Thanks a lot :)
I was able to break my code into sub codes and then give it a specific % of completion.
Again thanks, it workeddd perfectly )))))
 
Upvote 0

Forum statistics

Threads
1,223,992
Messages
6,175,834
Members
452,674
Latest member
psion2600

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top