VBA – Now Function

  • Post author:
  • Post category:VBA
  • Post comments:0 Comments
Function Now

The Function Now returns the current system date and time.

Syntax

Now()

Example

Add a button and add the following function.

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

When you execute the above function, it produces the following output.

The Value of a : 13/06/2021 3:04:09 PM 

Previous Page:-Click Here

Leave a Reply