With Sheets("Commande")
' Je définie la ligne de destination dans la base de données ' dernière ligne documentée +1
LigneDeDestination = .Range("A65536").End(xlUp).Row + 1
For Each Ctrl In Me.Controls
' Je tranfère les données en fonction de leur type ( numérique , date, string)
If Ctrl.Tag <> "" Then
' transfert des dates
If Split(Ctrl.Tag, " ")(2) = "date" Then
.Cells(LigneDeDestination, CByte(Split(Ctrl.Tag, " ")(0))) = CDate(Ctrl.Value)
' Transfert des valeures numérique
ElseIf Split(Ctrl.Tag, " ")(2) = "num" Then
.Cells(LigneDeDestination, CByte(Split(Ctrl.Tag, " ")(0))) = CDbl(Ctrl.Value)
Else
'*****************************************************************************************
On Error Resume Next
Select Case Split(Ctrl.Tag, "-")(0)
If Err > 0 Then
Err.Clear
GoTo suite
End If
Case "1", "6"
If Ctrl.Value = True Then .Cells(LigneDeDestination, CByte(Split(Ctrl.Tag, "-")(0))) = Ctrl.Caption
End Select
suite:
On Error GoTo 0
'*****************************************************************************************
' Transfert des strings
.Cells(LigneDeDestination, CByte(Split(Ctrl.Tag, " ")(0))) = Ctrl.Value
End If
If ChkBxContentions.Value = True Then
.Cells(LigneDeDestination, "Q").Value = "X"
End If
If ChkBxBar.Value = True Then
.Cells(LigneDeDestination, "P").Value = "X"
End If
If ChkBxBMR.Value = True Then
.Cells(LigneDeDestination, "N").Value = "X"
End If
If ChkBxCOV.Value = True Then
.Cells(LigneDeDestination, "O").Value = "X"
End If
If ChkBxO2.Value = True Then
.Cells(LigneDeDestination, "M").Value = "X"
End If
End If
Next
End With