Trying to write a macro for an assignment that will let you enter a date, display the year, month, and day in seperate msg boxes, then display if the date entered is from the future/past and compute the difference based on the current date.
Not sure how to get it to calculate the difference between the dates or the future/past part. I tried and If, then, else statement but it would only say "past" regardless of what date was put in.
Any help is greatly appreciated!
Sub macro1()
Dim TheDate As Variant
TheDate = InputBox("Insert: Date (mm/dd/yyyy)")
MsgBox Format(TheDate, "mmmm")
MsgBox Format(TheDate, "dd")
MsgBox Format(TheDate, "yyyy")
End Sub
Not sure how to get it to calculate the difference between the dates or the future/past part. I tried and If, then, else statement but it would only say "past" regardless of what date was put in.
Any help is greatly appreciated!
Sub macro1()
Dim TheDate As Variant
TheDate = InputBox("Insert: Date (mm/dd/yyyy)")
MsgBox Format(TheDate, "mmmm")
MsgBox Format(TheDate, "dd")
MsgBox Format(TheDate, "yyyy")
End Sub