Private Sub UserForm_Initialize()
With Sheets("BD") 'prend en compte l'onglet "BD"
'alimente la combobox "FamiliaListe" avec les éléments de la colonne A
Me.Familialiste.List = Range("A2:A" & .Cells(Application.Rows.Count, 1).End(xlUp).Row).Value
End With 'fin de la prise en compte l'onglet "BD"
End Sub
Private Sub Familialiste_Change()
Dim col As Byte 'déclare la variable col
col = Me.Familialiste.ListIndex + 2 'définit la colonne col
Me.ItemListe.Clear 'vide la combobox "ItemListe"
With Sheets("BD") 'prend en compte l'onglet "BD"
'alimente la combobox en fonction de la colonne col
Me.ItemListe.List = .Range(.Cells(2, col), .Cells(Application.Rows.Count, col).End(xlUp)).Value
End With 'fin de la prise en compte l'onglet "BD"
End Sub
Private Sub SpinButton1_Change()
Me.TextBox1.Value = Me.SpinButton1.Value 'écupère la valeur du SpinButton1 dans la TextBox1
End Sub
Private Sub CommandButton2_Click() 'bouton "Cancelar"
Unload Me 'vide et ferme l'UserForm
End Sub