Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find not finding programatically
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find a Named Range programatically using VBA in Excel | Excel Programming | |||
.find not finding corect value | Excel Programming | |||
Finding row number with .find() | Excel Programming | |||
Find/Replace not Finding | Excel Discussion (Misc queries) | |||
Programatically find Duplicate entries | Excel Programming |