DateDiff Function Example

This example uses the DateDiff function to display the number of days between a given date and today.

Dim TheDate As Date    ' Declare variables.
Dim Msg
TheDate = InputBox("Enter a date")
Msg = "Days from today: " & DateDiff("d", Now, TheDate)
MsgBox Msg