This is probably very simple but I'm struggling to get it to work. I found the code below which is used in a listbox as part of a filter. My problem is that the data being pulled into UBD1 is actually a time rather than a date. Can anyone advise what I should replace IsDate with as I'm assuming this is where the problem is?
strOperator1 = UBDC1
strOperator2 = UBDC2
If strOperator1 = "=" Then strOperator1 = ""
If strOperator2 = "=" Then strOperator2 = ""
If UBDand.Value = True Then
If IsDate(UBD1) Then .Range("F4") = strOperator1 & UBD1.Value
If IsDate(UBD2) Then .Range("G4") = strOperator2 & UBD2.Value
Else 'It's or
If IsDate(UBD1) Then .Range("F4") = strOperator1 & UBD1.Value
If IsDate(UBD2) Then .Range("F5") = strOperator2 & UBD2.Value
End If
strOperator1 = UBDC1
strOperator2 = UBDC2
If strOperator1 = "=" Then strOperator1 = ""
If strOperator2 = "=" Then strOperator2 = ""
If UBDand.Value = True Then
If IsDate(UBD1) Then .Range("F4") = strOperator1 & UBD1.Value
If IsDate(UBD2) Then .Range("G4") = strOperator2 & UBD2.Value
Else 'It's or
If IsDate(UBD1) Then .Range("F4") = strOperator1 & UBD1.Value
If IsDate(UBD2) Then .Range("F5") = strOperator2 & UBD2.Value
End If