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