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
Select Case Split(ctrl.Tag, " ")(0)
Case "1", "6"
If ctrl.Value = True Then .Cells(LigneDeDestination, CByte(Split(ctrl.Tag, " ")(0))) = ctrl.Caption
Case Else 'ajout ici
' Transfert des strings
.Cells(LigneDeDestination, CByte(Split(ctrl.Tag, " ")(0))) = ctrl.Value
End Select
End If
End If
Next
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 With