Dealing with time values in Excel is a nightmare!! Hopefully someone has an answer for this, how can you determine is a cell contains a time? To simplify things, lets say I want to check cells C5:C15 to see if either contains a time value, if so, simply return a "Yes". Obviously, the code below does not work or I would not be requesting help! It just returns "Yes" for any value. C5:C15 can contain time or text, so I would like to differentiate this. Any help would be appreciated!
[VBA]
Sub CheckforTime()
Dim rCell As Range
Dim myRange As Range
Dim x As Integer
Set myRange = Range("C5:C15")
For Each rCell In myRange
If rCell.Value > TimeValue("00:00:00") Then
MsgBox "YES"
Else
MsgBox "NO"
x = x + 1
End If
Next
End Sub
[/VBA]