Comment obtenir la date et l’heure actuelles au format « yyyy-MM-dd hh:mm:ss » dans une macro Excel VBA ?
Dim horodatage As String
horodatage = Format(Now, "yyyy-MM-dd hh:mm:ss")
MsgBox horodatage
Pour l’écrire dans une cellule :
Range("A1").Value = Format(Now, "yyyy-MM-dd hh:mm:ss")