Option Explicit
Private TDon(), VMax As Double, ParCode As Boolean
Private Sub UserForm_Activate()
TDon = Feuil1.[A1].Resize(Feuil1.Cells(2 ^ 20, "A").End(xlUp).Row).Value
VMax = WorksheetFunction.Max(TDon)
L = ActiveCell.Row
End Sub
Private Property Let L(ByVal RHS As Long)
Dim LMax As Long
LMax = UBound(TDon, 1)
ScrollBar1.Min = 1
ScrollBar1.Max = LMax
If RHS > LMax Then RHS = LMax
ParCode = True: ScrollBar1.Value = RHS: ParCode = False
Afficher
End Property
Private Property Get L() As Long
L = ScrollBar1.Value
End Property
Private Sub ScrollBar1_Change(): If ParCode Then Exit Sub
Afficher
End Sub
Private Sub Afficher()
Me.Km = TDon(L, 1)
Me.TbxProgress.Width = Me.TbxFond.Width * TDon(L, 1) / VMax
End Sub