LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Problem with Find Method


I am having a problem with the Find method of Range.

I have a macro that searches a worksheet using the Find method for a
particular value in column 1. Normally it will find the value and
return the range. However, sometimes when I rerun the macro and its
search for the same value it won't find it and returns nothing.

I have traced the execution and can see the value that it is search for
and I am certain that value exists in the range of the first column.
I'm using Find and not FindNext so I'm assuming every call to Find
resets to the top of the column and search down until found or not.

I have cut out three of the lines from the macro to show the exact
syntax I am using. Both ranges rJoints and rElements contain formulas
so I'm looking for values.

Set rJoints = wsPlotsheet.Columns(53) ' Column BA
Set rElements = Worksheets("Elements").Range("A1")
Set rFind = rJoints.Find(What:=rElements.Offset(i, 2), LookIn:=xlValues,
LookAt:=xlWhole)

To illustrate what the macro does is, it generates graphics with text
associates with each shape. I run the macro and it creates a new
worksheet with the graphics and associated text representing an
attribute. It works. I simply rerun the macro requesting the same
graphics but with a different attribute. The graphics should be
identical only the attribute changes. But it doesn't work, and I've
trace it to the Find method. It found the values the first time I run
but doesn't find the same value the next time.

Any suggestions would be appreciated.


*** Sent via Developersdex http://www.developersdex.com ***
 
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 Method problem in Excel VBA.... Irmann Excel Worksheet Functions 7 March 10th 08 03:49 AM
Problem with the FIND method looking for dates. jase[_2_] Excel Programming 2 November 14th 05 01:30 PM
Using variables to make a date and using find method to find that. KyWilde Excel Programming 2 April 21st 05 09:43 PM
Problem with find method Ralph Heidecke[_2_] Excel Programming 3 April 18th 05 08:07 PM
range.find method called into a VBA function (problem) Eros Pedrini Excel Programming 5 November 17th 04 12:34 PM


All times are GMT +1. The time now is 02:17 PM.

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

About Us

"It's about Microsoft Excel"