Date Calculations

  • Thread starter Thread starter marsue1995
  • Start date Start date
M

marsue1995

I need to write a statement I have the first part but can't figure out the
last. I'm sure it is simple.
Using DATEDIFF:
DATEDIFF(DAY, Assignment Date, Final Report date)...
If there is no date in the final report date field I want to use the Current
date field.
 
Try

Sub Macro()
Dim dtAssign As Date, dtFinal As Date

dtAssign = Range("A1")
dtFinal = IIf(Range("A2") = "", Date, Range("A2"))
MsgBox DateDiff("d", dtAssign, dtFinal)
End Sub

If this post helps click Yes
 
Back
Top