maval
XLDnaute Barbatruc
Bonjour,
J'ai sur un Formulaire un SpinButton qui fonctionne très vers le bas mais qui ne fonctionne vers le haut
Mon code de spinBoutton est celui-ci
Je vous remercie d'avance
J'ai sur un Formulaire un SpinButton qui fonctionne très vers le bas mais qui ne fonctionne vers le haut
Mon code de spinBoutton est celui-ci
Code:
'Avance rapide
Private Sub SpinButton1_SpinDown() 'la flèche vers le bas
LabelIndex.Visible = True
nom.Visible = True
If ComboBox1.ListIndex = -1 Then Exit Sub
If ComboBox1.ListIndex = 0 Then Exit Sub
ComboBox1.ListIndex = ComboBox1.ListIndex - 1
If ListBox1.ListIndex = -1 Then Exit Sub
If ListBox1.ListIndex = 0 Then Exit Sub
ListBox1.ListIndex = ListBox1.ListIndex - 1
End Sub
Private Sub SpinButton1_SpinUp() 'la flèche vers le haut
LabelIndex.Visible = True
nom.Visible = True
If ComboBox1.ListIndex = ComboBox1.ListCount - 1 Then Exit Sub
ComboBox1.ListIndex = ComboBox1.ListIndex + 1
If ListBox1.ListIndex = ListBox1.ListCount - 1 Then Exit Sub
ListBox1.ListIndex = ListBox1.ListIndex + 1
End Sub
'Avance rapide
Private Sub SpinButton1_Change()
Range("B" & SpinButton1.Value).Select
LabelIndex = SpinButton1.Value
With Sheets("Liste")
.Range("B" & LabelIndex + 3).Activate
nom.Caption = .Cells(LabelIndex + 3, 2)
.[B4:B65536].Interior.Color = RGB(255, 255, 255)
.Cells(LabelIndex + 3, 2).Interior.ColorIndex = 6
End With
End Sub
Je vous remercie d'avance

