View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Fred Smith[_4_] Fred Smith[_4_] is offline
external usenet poster
 
Posts: 2,389
Default Can't find certain date in search

Glad to help. Thanks for your feedback.

Fred.

"Ken" wrote in message
...
On Jun 30, 7:08 pm, "Fred Smith" wrote:
It would help if you posted the code for your search. However, I suspect
the
problem is "changed the dates to text". In text, January and October start
with the same number, so searching by text dates will always be
problematic.
In your example, the text string 10/1/2007 comes *before* the string
2/10/2007.

Search by real Excel dates. Then you won't have this problem.

Regards,
Fred.

"Ken" wrote in message

...



Hi Group,
It's me again....just got a quick question about a date search. I am
running a macro that I can enter a date in an input box, and then ask
it to search for every date on my log that fits a criteria pertaining
to that date.....
It will find every date that it is supposed to, i.e. < search date,
except ANY dates prior to Oct 1, 2007...(format is 10/1/2007).....I
have changed the dates to text to check to see if dates prior to that
have the correct numerical format, and they do. Now if I change the
macro to search date, the dates prior to Oct 1, 2007 show up along
with all the other dates that are actually search date. Has anyone
ran into this type of problem, and is there anyway to correct it?
Thanks to all!
Ken- Hide quoted text -


- Show quoted text -


Hi Fred,
Thanks for your answer.... After giving it further thought as I
typed this in, my column for the search is in the correct excel date
format, but my search value WAS a string, not date, so I changed to
"Dim LSearchValue As Date" instead of String, and voila!...it is
correct! Thanks Fred for your help!
Ken