Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Searching for specific text

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

Thank

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Searching for specific text

try this
Sub findxyz()
x = Range("d7:d12").Find("xyz", lookat:=xlPart).Address
MsgBox x
End Sub

sub gotoxyz
Range(Range("d7:d12").Find("xyz", lookat:=xlPart).Address).Select
end sub
--
Don Guillett
SalesAid Software

"simoncohen " wrote in message
...
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/



Reply
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
Searching for specific text - how to spacia Excel Worksheet Functions 0 May 13th 08 09:39 PM
Searching for case specific data Colin Foster Excel Discussion (Misc queries) 4 October 9th 07 06:10 PM
Searching two columns against a specific criteria Colin Excel Worksheet Functions 2 July 10th 07 07:20 PM
Searching for the presence of specific words Ryan Ferrell Excel Worksheet Functions 1 December 25th 05 10:34 PM
searching for specific text clerk Excel Discussion (Misc queries) 1 December 7th 05 12:16 AM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"