VBA - Fonction Now

La fonction maintenant renvoie la date et l'heure actuelles du système.

Syntaxe

Now()

Exemple

Ajoutez un bouton et ajoutez la fonction suivante.

Private Sub Constant_demo_Click()
   Dim a as Variant
   a = Now()
   msgbox("The Value of a : " & a)
End Sub

Lorsque vous exécutez la fonction ci-dessus, elle produit la sortie suivante.

The Value of a : 19/07/2013 3:04:09 PM