Can someone review my code below and let me know if you see anything I'm doing wrong? I'm trying to compare 2 dates, but I keep getting "Invalid procedure call or argument" on my first If line. When I step through, startDate = 6/29/2013 and compareToDate = 7/1/2013. I'm casting both as dates, what else am I missing?
Dim startDate As Date
Dim compareToDate As Date
startDate = CDate(ThisWorkbook.Sheets("Input Form").Range("StartDate"))
compareToDate = CDate("07/01/20" & Left(ThisWorkbook.Sheets("Input Form").Range("AwardYear"), 2))
If (startDate < compareToDate) Then
If ThisWorkbook.Sheets("Input Form").Range("HoursToJuneField1").text = "" Then
ThisWorkbook.UserInputDetected = False
Else
ThisWorkbook.UserInputDetected = True
End If
End If
Bookmarks