Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a Named Range programatically using VBA in Excel todtown Excel Programming 3 February 23rd 08 10:24 PM
.find not finding corect value treasuresflemar Excel Programming 1 December 11th 07 09:19 PM
Finding row number with .find() treasuresflemar Excel Programming 2 December 10th 07 11:37 PM
Find/Replace not Finding Sjones Excel Discussion (Misc queries) 1 June 21st 07 07:31 PM
Programatically find Duplicate entries Steph[_3_] Excel Programming 3 April 20th 05 06:36 PM


All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"