Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RaY RaY is offline
external usenet poster
 
Posts: 164
Default Find Question

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find my question? billnock Excel Discussion (Misc queries) 4 February 15th 10 07:59 AM
find question Gary Keramidas Excel Programming 1 August 18th 07 06:34 AM
how to find my question jonsey35 Excel Discussion (Misc queries) 2 August 10th 06 06:00 PM
find question Gary Keramidas Excel Programming 3 October 15th 05 03:40 AM
find question Gary Keramidas Excel Programming 0 October 15th 05 02:47 AM


All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"