View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ian G
 
Posts: n/a
Default If Then Statement Clarification

Try this code

Sub Dates()
firstdates = Range("a2") - Range("a1")
seconddates = Range("a3") - Range("a2")
If seconddates firstdates Then
MsgBox Range("a3")
Else
MsgBox Range("a1") + firstdates - seconddates
End If
End Sub

Ian G