Barre d'attente

Résolu
Fragnette Messages postés 22 Statut Membre -  
eriiic Messages postés 24581 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

Bonjour
je souhaiterai afficher une barre d'attente pendant l'éxécution de cette boucle
La barre se déroule apres la procédure , je voudrais pendant la procédure .

Worksheets("FEUIL1").Range("$B$7:$BH$23").Interior.Pattern = xlNone

Dim bir As Range
For Each bir In Worksheets("FEUIL1").Range("$B$7:$BH$23")
If bir = "M" Then
bir.Interior.ColorIndex = 22
ElseIf bir = "H" Then
bir.Interior.ColorIndex = 2
ElseIf bir = "P" Then
bir.Interior.ColorIndex = 8
ElseIf bir = "O" Then
bir.Interior.ColorIndex = 17
ElseIf bir = "N" Then
bir.Interior.ColorIndex = 16
ElseIf bir = "C" Then
bir.Interior.ColorIndex = 36
ElseIf bir = "V" Then
bir.Interior.ColorIndex = 15
ElseIf bir = "X" Then
bir.Interior.ColorIndex = 8

End If
Next

For i = 1 To 30000
Progressbarre i, 30000
Next
MsgBox ("Terminé")




https://www.cjoint.com/c/GAErFN0k0AA

Merci de votre aide précieuse

Cordialement

2 réponses

  1. eriiic Messages postés 24581 Date d'inscription   Statut Contributeur Dernière intervention   7 281
     
    Bonjour,

    essaie avec :
        Dim bir As Range, pl As Range, i As Long
        Set pl = Worksheets("FEUIL1").Range("$B$7:$BH$23")
        pl.Interior.Pattern = xlNone
        For Each bir In pl
            If bir = "M" Then
                bir.Interior.ColorIndex = 22
            ElseIf bir = "H" Then
                bir.Interior.ColorIndex = 2
            ElseIf bir = "P" Then
                bir.Interior.ColorIndex = 8
            ElseIf bir = "O" Then
                bir.Interior.ColorIndex = 17
            ElseIf bir = "N" Then
                bir.Interior.ColorIndex = 16
            ElseIf bir = "C" Then
                bir.Interior.ColorIndex = 36
            ElseIf bir = "V" Then
                bir.Interior.ColorIndex = 15
            ElseIf bir = "X" Then
                bir.Interior.ColorIndex = 8
            End If
            i = i + 1
            Progressbarre i, pl.Count
        Next
        MsgBox ("Terminé")

    Pas testé, je n'ai vu ton fichier qu'après.
    eric

    0
  2. Fragnette Messages postés 22 Statut Membre
     
    C'est tout bon
    Merci ERIIIC
    0
    1. eriiic Messages postés 24581 Date d'inscription   Statut Contributeur Dernière intervention   7 281
       
      ok, je met en résolu pour toi (en haut vers ton titre, pour la prochaine fois)
      eric
      0