Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I find out if a cell has my word in it?

There should be an easy answer to this:

I have a table in Excel 2003 and I want to be able to find a way to
check if my String variable is anywhere in that cell. The cell contains
a random number of names separated by spaces like this: "Jim Ted Bob
Sue"

I am thinking something like this:

Dim myName As String
Dim nameCount As Integer

For cell = 1 To 100
If ActiveCell.Value = myName Then 'obviously not working
nameCount = nameCount + 1
End If
Next cell

What is the trick to this?

Thanks everyone

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I find out if a cell has my word in it?


There is a function: Instr() who returns true is a string is in anothe
string

--
Kaa
-----------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...nfo&userid=751
View this thread: http://www.excelforum.com/showthread.php?threadid=49861

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
Find a cell's content in another cell but only as whole word(s) Paul Excel Worksheet Functions 2 February 5th 09 09:41 AM
In Excel, how do I find one word in a set of text in a cell? man818 Excel Discussion (Misc queries) 4 May 20th 06 02:20 PM
Find part of a word in cell Elaine Excel Discussion (Misc queries) 7 March 3rd 06 07:37 PM
Find last word in cell aph Excel Programming 5 October 17th 05 02:29 PM
find word in a cell then change cell format [email protected] Excel Programming 2 May 23rd 05 01:21 PM


All times are GMT +1. The time now is 05:23 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"