Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Searching Cells in Excel

I need to set up a search function in Excel so that it can idetify a given
word in a sentence, which is written in one cell. For example,

If Cell A1 is the place where the word you are looking for is written.

Then in Cell B1 the following sentence is written: "I like playing
football".

If the user puts in "football" in cell A1, I need it to return a true for B1
because it regonises "football" in the sentence.

--
Duncan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Searching Cells in Excel

Duncan:

example:

Dim f As Variant
Dim checktxt As Boolean
Range("A1").Select
f = Split(Range("B1"), " ")
For i = 0 To UBound(f)
If f(i) = Range("A1") Then
checktxt = True
Exit For
Else
checktxt = False
End If
Next i
MsgBox checktxt


--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Duncan" wrote:

I need to set up a search function in Excel so that it can idetify a given
word in a sentence, which is written in one cell. For example,

If Cell A1 is the place where the word you are looking for is written.

Then in Cell B1 the following sentence is written: "I like playing
football".

If the user puts in "football" in cell A1, I need it to return a true for B1
because it regonises "football" in the sentence.

--
Duncan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Searching Cells in Excel


if you need to know if the word present in cell A1 is in the cell B1
text you can put this formula in cell C1:
=FIND(A1,B1,1)


--
antoka05
------------------------------------------------------------------------
antoka05's Profile: http://www.excelforum.com/member.php...o&userid=29024
View this thread: http://www.excelforum.com/showthread...hreadid=487562

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Searching Cells in Excel

Thank you very much for your swift reponce. This sounds like the right
formula, but its just returning a number 16. I need it to say True if it
appears in the sentence, or a " 1" will do
--
Duncan


"antoka05" wrote:


if you need to know if the word present in cell A1 is in the cell B1
text you can put this formula in cell C1:
=FIND(A1,B1,1)


--
antoka05
------------------------------------------------------------------------
antoka05's Profile: http://www.excelforum.com/member.php...o&userid=29024
View this thread: http://www.excelforum.com/showthread...hreadid=487562


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 2 values from 2 cells Steve Excel Discussion (Misc queries) 5 January 25th 10 07:45 PM
Searching for Linked Cells jordanpcpre Excel Discussion (Misc queries) 4 December 3rd 08 01:08 AM
Searching a cells contents? SteW Excel Worksheet Functions 2 August 21st 07 11:48 AM
Searching for string in other cells Ruatha Excel Worksheet Functions 3 June 9th 06 10:42 PM
Is there any way of searching for duplicate cells? Lisa Excel Discussion (Misc queries) 1 October 3rd 05 09:19 AM


All times are GMT +1. The time now is 11:15 PM.

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"