ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   When using the find function....... (https://www.excelbanter.com/excel-programming/368953-when-using-find-function.html)

CarolineHedges[_20_]

When using the find function.......
 

Can you chose to look for a word *before* something, aswell as after
Cells.Find("word", After:=Equity..............

If not how I can i get around it, can i ask it to search within a rang
on a worksheet? ie within range A2:A500

--
CarolineHedge
-----------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...fo&userid=3570
View this thread: http://www.excelforum.com/showthread.php?threadid=56696


Dave Peterson

When using the find function.......
 
Nope. You're looking After:= a cell.

But you could find "Equity" first, then look after that found cell.

dim FoundEquity as range
dim FoundWord as range

with activesheet
set foundequity = .cells.find(what:="equity", .....

if foundequity is nothing then
msgbox "Equity wasn't found!"
else
set foundword = .cells.find(what:="word", after:=foundequity, ...

end if
end with



CarolineHedges wrote:

Can you chose to look for a word *before* something, aswell as after:
Cells.Find("word", After:=Equity..............

If not how I can i get around it, can i ask it to search within a range
on a worksheet? ie within range A2:A500?

--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=566967


--

Dave Peterson

ImpulseBlue

When using the find function.......
 
Yes. Instead of using 'Cells' as the range in the Find call, which is
the entire worksheet, you can specify any range in which it will search
in. So Range("A2:A500").Find("word", .. , should work. Be careful
with the find since it saves the settings for all the arguments it uses
each time. Always a good idea to just set them to what you need each
time. The help menu gives some good explanations.

CarolineHedges wrote:
Can you chose to look for a word *before* something, aswell as after:
Cells.Find("word", After:=Equity..............

If not how I can i get around it, can i ask it to search within a range
on a worksheet? ie within range A2:A500?


--
CarolineHedges
------------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...o&userid=35705
View this thread: http://www.excelforum.com/showthread...hreadid=566967



CarolineHedges[_21_]

When using the find function.......
 

Thanks ImpulseBlue

Yes I've notice that happens with the find!

Thanks very much. I'll give it a g

--
CarolineHedge
-----------------------------------------------------------------------
CarolineHedges's Profile: http://www.excelforum.com/member.php...fo&userid=3570
View this thread: http://www.excelforum.com/showthread.php?threadid=56696



All times are GMT +1. The time now is 05:14 PM.

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