View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Tushar Mehta Tushar Mehta is offline
external usenet poster
 
Posts: 1,071
Default scrolling to a specific cell

Speculative...might it have something to do with the difference between
Value and Value2? If A1 contains a date (1/1/2003), then
MsgBox TypeName([a1].Value) & ", " & TypeName([a1].Value2)
returns Date, Double.

In the code below, the 2nd Find faults:

Sub testIt2()
Dim x As Date, y As Long
x = #1/1/2003#: y = x
MsgBox x & ", " & y
MsgBox Cells.Find(x).Address
MsgBox Cells.Find(y).Address
End Sub

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I can't say why - I don't have the code for the Find method. I just know
that in my experience, match as I show, is much more reliable (never seen it
fail if there is a match - but even with that, I have to convert to long for
the search). On the other hand, I have plenty of problems with Find not
finding dates when they exist.

Some have suggest that for the lookin parameter xlValues works while others
say xlformulas work. I haven't found a consistent solution (and I imagine
this would be affected by how the value in the cell is produced). Tim
doesn't set any parameters, so such usage is a crap shoot as to what the
last setting the user applied was/is.

On the other hand, I work mostly in xl97 and xl2000, so it may not be a
problem for you.