Find time
After having tried several things, I finally found the
SIMPLE answer:
LookIn:=xlFormulas has to be changed to
LookIn:=xlValues
and then everything works just fine!
Thanks for your help Jim, you helped on the way to solving
it!
Martin
-----Original Message-----
Dear Jim:
The funny thing is that the code in the macro is exactly
the code I recorded with the macro recorder!
The formula bar actually shows "22:30:00" for the time
that appears as "22:30". If I use a "find" query (ctlr-f)
in the workbook with "22:30", Excel finds the value
without a problem (since it forms part of the time value
h:mm "22:30:00").
However, if I try to use the recorded macro in VBA (going
through it with F8), I get a runtime error no. 91
("object
variable or block With not established").
PS. I use a Spanish Excel 2002 version with a Spanish
Windows XP.
I still canīt figure out why things do not work from
12:30
until 23:00, and do work from 7:00 til 12:30!!
Any help appreciated!
Martin
-----Original Message-----
Excel's Edit, Find function compares the find string to
the actual contents
of the cells. The actual contents of the cell may be
different than the
value of the cell as it is displayed due to formatting.
If you select the
cell that displays "20:30" and look at the formula bar
you will see what is
actually in the cell. This is the value you must do
your
Find with. In my
case it is "8:30:00 PM", however if you have different
Windows Regional
Settings you may see something different.
--
Jim Rech
Excel MVP
.
.
|