Either of these will do. Just change the references to suit.
Sub ifinstr()
For Each x In Range("h1:h5")
For Each c In Range("i1:i5")
If InStr(1, c, x) > 0 Then c.Offset(, 1) = x.Row
Next c
Next x
End Sub
Sub iffound()
For Each cel In Range("h1:h5")
With Columns("i")
Set c = .Find(cel, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Offset(, 1) = cel.Row
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next cel
End Sub

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
>>
>> Give some detailed examples of what you would put in col C and what you
[quoted text clipped - 54 lines]
>
> Regards
newman - 12 Jul 2007 10:07 GMT
> Either of these will do. Just change the references to suit.
> Sub ifinstr()
[quoted text clipped - 83 lines]
> >
> > Regards
Don
Thank you
The first routine works well. However I have noticed a small problem.
Some of my larger strings in column C contain more than one string from
column B. How can I have these identified , perhaps in further columns
E,F,G,H etc
Col A B C D E F
Row
1 1 abc xxefghxxx 2
2 2 efgh xxyyyxx
3 3 mnopq xxxabcxxrstuxvwxyxx 1 4 5
4 4 rstu xxxefghxxx 2
5 5 vwxy xxrstuxxxmnopqxx 4 3
Regards
Don Guillett - 12 Jul 2007 14:42 GMT
This seems to do it
Sub iffound()
For Each cel In Range("h1:h5")
With Columns("i")
Set c = .Find(cel, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
mc = Cells(c.Row, cel.Column).End(xlToRight).Column + 1
Cells(c.Row, mc) = cel.Row
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
Next cel
End Sub

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
>>
>> Either of these will do. Just change the references to suit.
[quoted text clipped - 108 lines]
>
> Regards
newman - 13 Jul 2007 10:06 GMT
> This seems to do it
> Sub iffound()
[quoted text clipped - 130 lines]
> >
> > Regards
Don
The second routine does not seem to do anything.
I am using Visual Basic 6.0
Regards
Don Guillett - 13 Jul 2007 13:27 GMT
This is vba within excel and was fully tested.

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
>>
>> This seems to do it
[quoted text clipped - 142 lines]
>
> Regards
Don Guillett - 13 Jul 2007 14:01 GMT
Send a workbook to me if desired.

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> This is vba within excel and was fully tested.
>
[quoted text clipped - 146 lines]
>>
>> Regards
newman - 14 Jul 2007 09:52 GMT
> Send a workbook to me if desired.
>
[quoted text clipped - 159 lines]
> >>
> >> Regards
Don
I think I have found the problem. It may have been a variables issue. I
was running routine 2 after running routine 1.
I opened a new workbook and it ran ok.
I am familiar with BASICA and QBASIC but I am just getting started with
VBA. Can you recommend a good tutorial?
newman - 19 Jul 2007 09:43 GMT
> I think I have found the problem. It may have been a variables issue. I
> was running routine 2 after running routine 1.
>
> I opened a new workbook and it ran ok.
That routine works ok but the result does not fully meet my needs. I
need to take another approach.
I wish to search a block of text in a cell for any strings of text
within double quotation marks and put this string in a new column. If
there are more than one set of quotation marks then the subsequent
strings should be put in the next row. Is this possible?
e.g..
xxx"abc"xxxx"def"xxxx"ghijk"xxxxxx abc
def
ghijk
Regards
newman - 26 Jul 2007 10:04 GMT
> Either of these will do. Just change the references to suit.
> Sub ifinstr()
[quoted text clipped - 83 lines]
> >
> > Regards
Don
The first routine is working well. However The number of rows in both
columns varies and I have to change the macro each time. Can it be
modified to check down both columns for all strings in that column.
Regards