Find not finding programatically
I've seen strange things happen with merged cells.
Your problem adds to my list of reasons not to use merged cells!
J Streger wrote:
I have a situation where I use the find command in my VBA code and it is not
finding the data I want, yet the find works perfectly when I use it through
the GUI. I know that they are one in the same, as in setting parameters in
the code, sets new defaults for the GUI, so I can't understand why the code
fails.
The line I am using is:
If Not rngTemp2.Find(what:="Overall", LookIn:=xlValues, _
LookAt:=xlPart) Is Nothing Then
I added a rngTemp2.select prior to the line so I could see the range it was
selecting. The range is merged, but I tried the entire merged area and just
the single column and neither worked. In fact, after it fails to find it via
the code I stop the code and hit Alt-F and try the find exactly as it comes
up, and it finds it perfectly fine. Any reason for this weird behavior
(usually thy both fail).
--
*********************
J Streger
MS Office Master 2000 ed.
MS Project White Belt 2003
User of MS Office 2003
--
Dave Peterson
|