Unanswered: VBA to compare columns and populate column
I need my subroutine to compare the dates of two columns, and depending on the result, populate a third column.
The sheet I inherited had done this as a formula and thus even without dates present would populate the On Time column with "Yes" to oblivion, making the file size unmanageable. This is the code I'm currently using and it doesn't seem to work. (Forgive my ignorance I'm a VBA beginner).
Dim DueDate, RecDate As Date
DueDate = TimeValue(Range("O2").Text)
RecDate = TimeValue(Range("P2").Text)
If DueDate <> Null And RecDate > DueDate Then
Range(Q2).Value = "No"
If DueDate <> Null And RecDate <= DueDate Then
Range(Q2).Value = "Yes"