Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
URGENT - Formulas stopped working | Excel Discussion (Misc queries) | |||
URGENT! Please please help me get smtp mail send working.. | Excel Programming | |||
Urgent Please: PasteSpecial not working. Very wierd | Excel Programming | |||
Advanced Filter stopped working. URGENT | Excel Programming | |||
Round Function has stopped working - Urgent | Excel Programming |