How do I find out if a cell has my word in it?

  • Thread starter Thread starter j1degiovann
  • Start date Start date
J

j1degiovann

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
 
There is a function: Instr() who returns true is a string is in anothe
string
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top