LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Using Find with dates

I'm using the following, which is essentially a cut and paste for Excels VB
help, to search for a date held in a variable, CellDt.
I create CellDt with DateValue, so I know it's valid. Plus the dates in
column A are also valid (I've formatted the column to with Numbers |
Date...etc., and I've set a variable to the contents of a few random cells
and used TypeName to confirms it's a date.
But C is always set to nothing; it never changes.
If I change the range to the next column and search for a string, it does
find it (C is set to the value found), so it seems it has something to do
with the date(s) themselves...but I can't see what it might be.

With Worksheets(1).Range("A1:A119")
Set C = .Find(what:=CellDt, LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
' copy found item to variable, etc.
' . . .
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address < firstAddress

Any thoughts? And thanks.

Bert


 
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
compare 2 tables of dates to find the preceding dates Babi Excel Worksheet Functions 3 October 28th 08 05:52 AM
FIND and dates Molly Excel Worksheet Functions 1 June 30th 08 09:44 PM
Find the three nearest dates magdiego Excel Worksheet Functions 8 June 19th 08 03:24 AM
Find future dates LiLi Excel Discussion (Misc queries) 3 September 15th 06 04:38 AM
How do I find the earliest dates in a range of dates? JJ Excel Worksheet Functions 3 May 16th 06 09:36 AM


All times are GMT +1. The time now is 06:01 PM.

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

About Us

"It's about Microsoft Excel"