Bonsoir, bonsoir le forum,
Je ne comprends pas à quoi sert la ComboBox1 ? Ci-dessous ton code modifié qui, chez moi, ne plante pas :
Private Sub UserForm_Initialize()
Dim COL As Byte
For COL = 2 To 8
ComboBox1.AddItem Cells(3, COL).Value
Next COL
End Sub
Private Sub TextBox1_AfterUpdate()
TextBox1 = Format(TextBox1, "00")
End Sub
Private Sub TextBox2_AfterUpdate()
TextBox2 = Format(TextBox2, "h:mm")
End Sub
Private Sub CommandButton1_Click()
Dim RL As Range
Dim RC As Range
Dim LI As Integer
Dim COL As Byte
Set RL = Rows(3).Find(Me.TextBox1.Value, , xlValues, xlWhole)
If Not RL Is Nothing Then
COL = RL.Column
Else
MsgBox "Ce jour ne figure pas dans la liste !": Exit Sub
End If
Set RC = Columns(1).Find(Me.TextBox2.Value, , xlValues, xlWhole)
If Not RC Is Nothing Then
LI = RC.Row
Else
MsgBox "Cet horaire ne figure pas dans la liste !": Exit Sub
End If
Cells(LI, COL).Value = TextBox3.Value
Cells(LI, COL).Select
Unload Me
End Sub