LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default URGENT! Range.find not working...

if you have only one cell selected, Excel search trough the whole sheet. You
could had a check before you use the Find method (untested):

if range.cells.count=1 then
if range=DataToSearch then
set result=range
end if
else
set result=range.find....
end if

by the way, I wouldn't name my variable "range" because this name is already
used be VBA which may lead to problem. Use something like

dim rngSearchArea as range

p-a

"Jorge Ribeiro" wrote:

Hello

I've an urgent question

I need to find a string in a range but only inside it
So far i've been using

Excel.Range result = range.Find(dataToSearch,
Type.Missing,
Type.Missing,
Excel.XlLookAt.xlWhole,
Excel.XlSearchOrder.xlByRows,
Excel.XlSearchDirection.xlNext,
Type.Missing,
Type.Missing,
Type.Missing);

whre dataToSearch is my string to find, and range is where i want to find it.

this does not work because if it can't find a string in my range it
continues to
search in the rest of the sheet.
I tried several times with several parameters and the result was the same...

onde i definied my range to be only one cell X11 and then look for "2" in
it...
my range didn't had that value in it but the above command returned another
range pointing to CA11 where it had value "2" in it.

I need urgently to find a valur only inside a range not in all sheet space

please help me here
its really urgent

Regards, Jorge

 
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
URGENT - Formulas stopped working Edward Excel Discussion (Misc queries) 6 April 15th 09 02:13 PM
URGENT! Please please help me get smtp mail send working.. Duncan[_5_] Excel Programming 3 July 27th 06 02:48 PM
Urgent Please: PasteSpecial not working. Very wierd michael.beckinsale Excel Programming 2 July 17th 06 01:22 PM
Advanced Filter stopped working. URGENT Bren Excel Programming 4 November 5th 05 02:30 PM
Round Function has stopped working - Urgent Stuart[_5_] Excel Programming 3 March 4th 04 08:43 PM


All times are GMT +1. The time now is 01:59 AM.

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"