View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Searching for specific text

Hi
one way: try something like
sub foo()
dim rng as range
dim cell as range
set rng = activesheet.range("A1:A100")
for each cell in rng
if instr (cell.value,"xyz") then
msgbox cell.address
cell.select
exit sub
end if
next
end sub

--
Regards
Frank Kabel
Frankfurt, Germany


I need to loop down a range and stop when a cell contains the text
"xyz" somewhere within a cell.

Thanks


---
Message posted from http://www.ExcelForum.com/