Sub Essai()
'========================= GESTION COMMANDE ============================
L = WsCmd.Cells(Rows.Count, 6).End(xlUp).Row
Do While IsEmpty(WsCmd.Cells(L, 6)): L = L - 1: Loop
L = L + 1: H = L
With Me.List_Pieces
For i = 0 To .ListCount - 1
For j = 0 To 5
WsCmd.Cells(L, j + 7) = Me.List_Pieces.List(i, j)
Next j
L = L + 1
Next i
End With
For i = H To L - 1
For Each CTRL In Me.Controls
If IsNumeric(CTRL.Tag) = True Then
If CTRL.Tag <> "2" Then
WsCmd.Cells(i, CInt(CTRL.Tag)) = CTRL
Else
WsCmd.Cells(i, 2) = CDate(Me.txt_date) 'Sinon on a une date en Texte dans la feuille !
End If
End If
Next CTRL
Next i
End Sub