Private Sub CommandButton1_Click() ' USERFORM >>>> ANNULATION
Dim L As Integer ' A
Dim x As Byte
Dim c As Range
If TextBox14.Text <> "" Then ' si Oui
MsgBox "BC Déja annulé le : " & TextBox14.Text, vbCritical, _
"Annulation Impossible !"
Else ' si Non
With Sheets("Feuil2")
'.Activate
L = .Range("A65536").End(xlUp).Row + 1 'A
For x = 1 To 13
.Cells(L, x).Value = Me.Controls("TextBox" & x).Value
Next x
For x = 10 To 13
.Cells(L, x).Value = Me.Controls("TextBox" & x).Value * -1
Next x
.Cells(L, 4).Value = Cells(L, 4).Value & ".ANNL"
.Cells(L, 14).Value = Format(Now, "mm/dd/yyyy") & " " & Format(Now, "hh:mm:ss")
Set c = .Range("d2:d" & .Range("d65536").End(xlUp).Row).Find(TextBox4)
c.Offset(0, 10).Value = Format(Now, "mm/dd/yyyy")
'------------------------
'tri selon le N°BC
.Range("D1").CurrentRegion.Sort Key1:=Range("D1"), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End If
Unload Me
End Sub