ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with a search (https://www.excelbanter.com/excel-programming/330289-problem-search.html)

funkymonkUK[_13_]

Problem with a search
 

Hi I have the below code which searches a selection for the word
download however it keeps on saying it cannot find it. Any ideas, I
know it is in there as the select is not big at present but will be
quiet huge in future.


Range("A6").Select
Selection.CurrentRegion.Select
Set exportfind = cell.Find(What:="Download", After:=Range("a6"),
LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False)

Regards


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=374500


Tom Ogilvy

Problem with a search
 
where is "cell" defined. Perhaps you mean

Range("A6").Select
Selection.CurrentRegion.Select
Set exportfind = Selection.Find(What:="Download", After:=Range("a6"),
LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False)

If Download isn't by itself in the cell with no leading or trailing spaces,
try changing xlWhole to xlPart

--
Regards,
Tom Ogilvy

"funkymonkUK"
wrote in message
...

Hi I have the below code which searches a selection for the word
download however it keeps on saying it cannot find it. Any ideas, I
know it is in there as the select is not big at present but will be
quiet huge in future.


Range("A6").Select
Selection.CurrentRegion.Select
Set exportfind = cell.Find(What:="Download", After:=Range("a6"),
LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False)

Regards


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile:

http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=374500





All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com