Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default .find not finding formula result

Set sc = ActiveWorkbook.Sheets("Region").Rows("4:4").Find(l store)

lstore value is "chicago". When a cell in row 4 has a value of "chicago",
the line works fine. But when a cell in row 4 has a formula that results in
"chicago", sc is Nothing. What am I doing wrong?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default .find not finding formula result

The parms related to the .find command are shared with the user.

So if the user told excel to "match entire cell contents", then you're line of
code is using that setting. (Same thing with the matchcase, too.)

You'd be better off specifying all the parms in the .find statement than
trusting that those settings are what you want/expect.

Aaron wrote:

Set sc = ActiveWorkbook.Sheets("Region").Rows("4:4").Find(l store)

lstore value is "chicago". When a cell in row 4 has a value of "chicago",
the line works fine. But when a cell in row 4 has a formula that results in
"chicago", sc is Nothing. What am I doing wrong?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default .find not finding formula result

By default the find is looking at what is typeed in formulas (LookIn:=
xlFormulas), not the results of the formulas.

Try something like this....

Set sc = ActiveWorkbook.Sheets("Region").Rows("4:4").Find(W hat:=lstore,
After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False

"Aaron" wrote:

Set sc = ActiveWorkbook.Sheets("Region").Rows("4:4").Find(l store)

lstore value is "chicago". When a cell in row 4 has a value of "chicago",
the line works fine. But when a cell in row 4 has a formula that results in
"chicago", sc is Nothing. What am I doing wrong?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default .find not finding formula result

I could not duplicate your problem when argument LookIn:=xlValues was used.
Apparently your arguments need to be set to accomodate your conditions.

"Aaron" wrote:

Set sc = ActiveWorkbook.Sheets("Region").Rows("4:4").Find(l store)

lstore value is "chicago". When a cell in row 4 has a value of "chicago",
the line works fine. But when a cell in row 4 has a formula that results in
"chicago", sc is Nothing. What am I doing wrong?

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 formula result Jaleel Excel Discussion (Misc queries) 4 October 19th 09 07:44 PM
finding 1 formula result in a group of cells Richdg New Users to Excel 6 June 1st 09 06:44 PM
Finding minum positive from the result of formula haviv Excel Discussion (Misc queries) 8 July 18th 07 09:58 AM
How can I find cell contains the result of "maximum" formula De Excel Discussion (Misc queries) 6 October 26th 06 08:46 PM


All times are GMT +1. The time now is 05:44 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"