Progressbar

chanu

XLDnaute Junior
Progressbar : Problème d'affichage

Bonjour le forum, j'ai un soucis avec ma progressbar, elle ne s'affiche pas tout simplement:(. Si quelqu'un pouvais de donner un coup de pouce parce qu'à force d'être dedans je m'y perd:eek:
Code:
Sub Lancement() 'Lancement du travail des statistiques
Worksheets(1).Select
  
  Counter = 0
  For L = 1 To 10
    For K = 1 To 10
      Range("D1") = Counter
      Counter = Counter + 1
        For Tempo = 1 To 5000000
        Next Tempo
            
      With frmProgressBar
        .FrameProgress.Caption = Format(Counter / 100, "0%")
        .LabelProgress.Width = Counter * 2
        .Repaint
                     
            Dim c
            For c = 256 To 5 Step -1
                If Cells(100, c).End(xlUp).Row = 1 Then
                Cells(1, c).EntireColumn.Delete
                End If
            Next c
        End With
    Next K
  Next L
    frmProgressBar.Hide
End Sub

Je voudrais en fait que ma progressbar s'active pendant ma boucle c, donc j'ai pensé à un compteur...
Merci d'avance
 
Dernière édition:

chanu

XLDnaute Junior
Re : Progressbar

Bonjours le forum, j'ai résolu mon problème en y passant un peu de temps (c'est pas évident quand on s'y met depuis peu lol)
Je vous poste le code que je vais utiliser pour ceux que ça interresse
Code:
Sub Lancement()
Worksheets(1).Select

For c = 256 To 5 Step -1
  Counter = 1 - c / 256

    Application.StatusBar = Format(1 - c / 256, "0%")
    Worksheets(1).Select
    With frmProgressBar
        .FrameProgress.Caption = Format(Counter, "0%")
        .LabelProgress.Width = Counter * 200
        .Repaint
            If Cells(100, c).End(xlUp).Row = 1 Then
            Cells(1, c).EntireColumn.Delete
            End If
    End With
Next c
Application.StatusBar = "Prêt"
frmProgressBar.Hide
End Sub
 

Discussions similaires

Réponses
0
Affichages
288

Statistiques des forums

Discussions
312 859
Messages
2 092 904
Membres
105 559
dernier inscrit
Alain Poleszczuk