Thread: Date Find
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Unger Dave Unger is offline
external usenet poster
 
Posts: 153
Default Date Find

Hello,

I have 2 columns of dates (rng1 and rng2). For each entry in rng1 I
need to find a match, if any, in rng2. Rng1 is formatted as
"01/28/07", while rng2 is "01/28/2007 05:00:00 PM".

The only way I can get the Find method to work is by formatting rng2
as serial, doing the
find, then restoring the original format. The example here seems to
be the only variation of Find that works for me. There must be a way
to avoid having to change the format.

For Each cell1 In rng1

Set Y = rng2.Find(what:=CLng(cell1), LookIn:=xlValues,
lookat:=xlPart)

Next cell1


Regards,

DaveU