1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
'Pour Barre de progression
Public xCompteurX As Variant
Public xPour100X As Single
sub magrossemacro()
UserForm1.Show vbModeless 'Affiche Barreprogression dans état modeless
xCompteurX = 0
'dans ma boucle
Call BarreDeProgression
'fin ma boucle
End Sub
Sub BarreDeProgression()
Application.ScreenUpdating = False
xCompteurX = xCompteurX + 5 'Le nombre est à régler en fonction de votre routine. De la durée de votre routine
'En lieu et place de 5 vous pouvez mettre 1 ou 2 ou 3.5 ou 12 ou 7.1 ou 20 etc..
xPour100X = xCompteurX / 100
With UserForm1
.FrameProgress.Caption = Format(xPour100X, "0%")
.LabelProgress.Width = xPour100X * (.FrameProgress.Width - 10)
End With
DoEvents 'L'instruction DoEvents est responsable de la mise à jour de l'Userform
End Sub |
Partager