Private Sub ComboBox_Nombre_Adulte_Change()
Me.ComboBox1.ListIndex = 0
End Sub
Private Sub UserForm_Initialize()
Dim CTRL As Control
Dim x As Byte
With Me
.ComboBox_Nombre_Adulte.List = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20")
.ComboBox2.List = Array("", "1", "2", "3", "4", "5", "6") 'Bébé
.ComboBox1.List = Array("", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12") 'Enfant
.ComboBox1.ListIndex = 0
End With
End Sub
Private Sub Combobox1_Change()
Dim CTRL As Control
Dim x As Byte
Dim ii As Byte
Dim oDebut As Byte, oFin As Byte
With Me
For ii = 1 To 12
.Controls("TextBox" & ii).Visible = True
.Controls("Label" & ii).Visible = True
Next ii
'Pour 0
If .ComboBox1 = "" Then
oDebut = 1: oFin = 12
End If
'Pour 1
If .ComboBox1 = "1" Then
oDebut = 2: oFin = 12
End If
'Pour 2
If Me.ComboBox1 = "2" Then
oDebut = 3: oFin = 12
End If
'Pour 3
If Me.ComboBox1 = "3" Then
oDebut = 4: oFin = 12
End If
'Pour 4
If .ComboBox1 = "4" Then
oDebut = 5: oFin = 12
End If
'Pour 5
If .ComboBox1 = "5" Then
oDebut = 6: oFin = 12
End If
'Pour 6
If .ComboBox1 = "6" Then
oDebut = 7: oFin = 12
End If
'Pour 7
If .ComboBox1 = "7" Then
oDebut = 8: oFin = 12
End If
'Pour 8
If .ComboBox1 = "8" Then
oDebut = 9: oFin = 12
End If
'Pour 9
If .ComboBox1 = "9" Then
oDebut = 10: oFin = 12
End If
'Pour 10
If .ComboBox1 = "10" Then
oDebut = 11: oFin = 12
End If
'Pour 11
If .ComboBox1 = "11" Then
oDebut = 12: oFin = 12
End If
''Pour 12
If .ComboBox1 = "12" Then
Exit Sub
End If
For ii = oDebut To oFin
.Controls("TextBox" & ii).Visible = False
.Controls("Label" & ii).Visible = False
Next ii
End With
End Sub