Hi Dave,
Thanks very much for the suggestion.
I used the "isdate" function as below, if the cell is not visible as a
string I have used the serial # & v.v.
There is probably a tidier way of presenting it, but I'm just learning
(so your guess is a lot better than mine!) & it seems to work so
far...
Code:
--------------------
'Checks if current cell is a date _
& shows FilterValue of current cell as date or string
If IsDate(ActiveCell) Then
AsSerial:
CurrentCellType = "Serial"
FilterValue = CLng(CDate(ActiveCell))
Else
AsString:
CurrentCellType = "String"
FilterValue = ActiveCell
End If
Selection.AutoFilter Field:=ColToFilter, Criteria1:="=" & FilterValue, Operator:=xlOr, _
Criteria2:="=*" & FilterValue & "*"
If ActiveCell.EntireRow.Hidden Then
Select Case CurrentCellType
Case Is = "Serial"
GoTo AsString:
Case Is = "String"
GoTo AsSerial:
End Select
Else
End If
--------------------
btw, this is just part of a larger macro which is why the else is
empty.
Thanks for your help,
Rob Brockett
NZ
Always learning & the best way to learn is to experience...
--
broro183
------------------------------------------------------------------------
broro183's Profile:
http://www.excelforum.com/member.php...o&userid=30068
View this thread:
http://www.excelforum.com/showthread...hreadid=358973