Private Sub cmdValider_Click()
Application.ScreenUpdating = False
Dim DerLig As Long
If Me.ComboBox1 <> "New" Then
lig = Val(Me.ComboBox1) + 1
For i = 1 To 17
If IsNumeric(Me.Controls("Txt" & i).Value) Then
Cells(lig, i + 1).Value = Val(Me.Controls("Txt" & i).Value)
Else
Cells(lig, i + 1).Value = UCase(Me.Controls("Txt" & i).Value)
End If
Next i
On Error Resume Next
Cells(lig, 5).Replace What:=Chr(13), Replacement:="", LookAt:=xlPart
On Error GoTo 0
Else
DerLig = [A65000].End(xlUp).Row + 1
Cells(DerLig, 1).Value = Cells(DerLig - 1, 1).Value + 1
For i = 1 To 17
If IsNumeric(Me.Controls("Txt" & i)) Then
Cells(DerLig, i + 1).Value = Val(Me.Controls("Txt" & i).Value)
Else
Cells(lig, i + 1).Value = UCase(Me.Controls("Txt" & i).Value) souligné en jaune
End If
Next i
On Error Resume Next
Cells(DerLig, 5).Replace What:=Chr(13), Replacement:="", LookAt:=xlPart
On Error GoTo 0
Range("B2:R" & DerLig).Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("C2") _
, Order2:=xlAscending, Header:=xlGuess
End If
Cells.VerticalAlignment = xlCenter
Unload Me
Application.ScreenUpdating = True
End Sub