Thread: Find Question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Find Question

How about:

Sub LostandFound()
Dim TimeMatch As String
TimeMatch = Range("K6").Text

Cells.Find(What:=TimeMatch, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate
End Sub

--
Gary''s Student - gsnu200856


"Ray" wrote:

I've tried using the following code to find a time stamp

Cells.Find(What:="21:30:00", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate

Which works to find the time 21:30:00. But the following does not work

Dim TimeMatch As Date
TimeMatch = Range("K6").Value
Cells.Find(What:=TimeMatch, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate

Can anyone tell me why or what I'm doing wrong.

Thanks,
-Ray