Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search using the words in a cell


Is there any way to search using the words in a cell? The reason I need
to do that is because I have to enter in a lot of data and need to
search each word entered in each seperate cell and find it on a
different page.


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497369

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Search using the words in a cell

Hi,
Look at VBA FIND function. Code below is modified from VBA help.


HTH

With Worksheets(1).Range("a1:a500") ' Search A1 to A500 in Worksheets(1)

MyWord=Range("c1") ' <== change for your Cell(s)

Set c = .Find(MyWord, lookin:=xlValues)
If Not c Is Nothing Then ' MyWord found .....
firstAddress = c.Address
Do
..... add your code
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress 'Keep
searching until all found
End If
End With


"jj33002" wrote:


Is there any way to search using the words in a cell? The reason I need
to do that is because I have to enter in a lot of data and need to
search each word entered in each seperate cell and find it on a
different page.


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497369


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Search using the words in a cell

for each cell in selection
With Worksheets("Other").Cells
set rng = .Find(What:=cell.Value, _
After:=.Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
End With
if not rng is nothing then
msgbox cell.Value & " found at " _
& rng.Address(0,0,xlA1,True)
else
msgbox cell.Value & " not found"
end if
Next

--
Regards,
Tom Ogilvy


"jj33002" wrote in
message ...

Is there any way to search using the words in a cell? The reason I need
to do that is because I have to enter in a lot of data and need to
search each word entered in each seperate cell and find it on a
different page.


--
jj33002
------------------------------------------------------------------------
jj33002's Profile:

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search using the words in a cell


Hello,

I appreciate the help I used the code that Tom provided and it does
what I wanted it to. The only thing is that instead of a message box
of where the cell is found, is there any way to just select that cell?


--
jj33002
------------------------------------------------------------------------
jj33002's Profile: http://www.excelforum.com/member.php...o&userid=30020
View this thread: http://www.excelforum.com/showthread...hreadid=497369

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
search of words bookworm Excel Discussion (Misc queries) 3 February 12th 07 07:42 PM
Search And Replace Whole Words Mary H Excel Programming 2 December 21st 05 08:58 PM
Search for specific words Newberry Excel Worksheet Functions 3 July 21st 05 10:18 PM
Search for multiple words Kassie Excel Discussion (Misc queries) 0 March 25th 05 05:21 PM
Search filename containing words Bob Phillips[_6_] Excel Programming 0 December 22nd 04 09:44 AM


All times are GMT +1. The time now is 03:19 PM.

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

About Us

"It's about Microsoft Excel"