Private Sub CmdNouv_Click()
Dim j As Integer
Set cell = Range("A3:A" & Application.Max(3, Range("A" & Rows.Count).End(xlUp).Row)) _
.Find(CmbNom, lookat:=xlWhole)
If Not cell Is Nothing Then
MsgBox CmbNom & " Existe déjà." & Chr(13) & "Vous ne pouvez que le modifier ou le supprimer", 16
Exit Sub
End If
lgn = Application.Max(3, Range("A" & Rows.Count).End(xlUp)(2).Row)
For j = 1 To 7
If IsNumeric(Controls("textBox" & j)) Then
Cells(cell.Row, j) = CLng(Controls("textBox" & j))
Else
Cells(cell.Row, j) = Controls("textBox" & j)
End If
Next j
Range("A3:G" & lgn).Sort key1:=Range("A3"), order1:=xlAscending, Header:=xlNo