Option Explicit
'Private WithEvents CLs As CLsCAs.ComboBoxLiées, LCou As Long, TVL()
Private WithEvents CLs As ComboBoxLiées, LCou As Long, TVL()
Private Sub UserForm_Initialize()
' Set CLs = CLsCAs.Création.ComboBoxLiées
Set CLs = New ComboBoxLiées
CLs.Plage Feuil2.[A2:D2], True
CLs.Add Me.ChoixNom, 1
CLs.Add Me.ChoixPrenom, 2
CLs.Add Me.NomEnfant, 3
CLs.Add Me.ComboBox1, 4
CLs.CouleurSympa
CLs.LMaxDropBtn = 25
CLs.Actualiser
End Sub
Private Sub CLs_Change(ByVal Complet As Boolean, ByVal NbrLgn As Long)
If NbrLgn = 1 Then Exit Sub
LCou = 0
ReDim TVL(1 To 1, 1 To CLs.PlgTablo.Columns.Count)
End Sub
Private Sub CLs_BingoUn(ByVal Ligne As Long)
LCou = Ligne
TVL = CLs.PlgTablo.Rows(LCou).Value
End Sub
Private Sub BoutonAjouter_Click()
If LCou <> 0 Then Exit Sub
CLs.ValeursVers TVL
LCou = CLs.PlgTablo.Rows.Count
CLs.PlgTablo.Rows(LCou).Copy
CLs.PlgTablo.Rows(LCou).Insert xlShiftDown
LCou = LCou + 1
CLs.PlgTablo.Rows(LCou).Value = TVL
CLs.Actualiser
End Sub
Private Sub BoutonSupprimer_Click()
If LCou = 0 Then Exit Sub
CLs.PlgTablo.Rows(LCou).Delete xlShiftUp
CLs.Actualiser
End Sub
Private Sub BoutonQuitter_Click()
Unload Me
End Sub