ref = Sheets("Enregistrement").[C9]
With Sheets("BDD")
lig = Application.Match(ref, .Columns("A"), 0)
If IsNumeric(lig) Then
'trouvé
If .Cells(lig, 4) = Date Then
If MsgBox("Donnée déjà existante. Forcer l'enregistrement ?", vbYesNo, "Demande de confirmation") = vbYes Then
'trouvé et oui on mets Qte et ??? pas la peine de remettre la date
' .Cells(lig, 2) = Qte
' .Cells(lig, 3) = ???
''''''''''''' .Cells(lig, 4) = Format(Date, "mm/dd/yyyy")
End If
End If
Else
'non trouvé
lig = .[D65536].End(xlUp).Row + 1 'dernière ligne +1
.Cells(lig, 1) = ref
'.Cells(lig, 2) = Qte
.Cells(lig, 4) = Format(Date, "mm/dd/yyyy")
End If
End With