View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mary M[_4_] Mary M[_4_] is offline
external usenet poster
 
Posts: 1
Default Find words and neighbors using wildcards


Hi Tom,

I was just coming to post that I think I got the answer, and then
find you solved it!

Well, here's my version:


Code
-------------------

Sub Find_Words()
' Select cell A2, *first line of data*.
Range("A2").Select
' Set Do loop to stop when an empty cell is reached.
Do Until IsEmpty(ActiveCell)

Dim root As String
root = ActiveCell.Value

If ActiveCell.Offset(0, 1).Value 100 Then
Dim i As Integer
For i = 1 To 10
Dim deriv As String
deriv = ActiveCell.Offset(i, 0).Value
If InStr(deriv, root) = 1 Then
If ActiveCell.Offset(i, 1).Value < 50 Then
ActiveCell.Offset(0, 2).Value = root
ActiveCell.Offset(i, 2).Value = deriv
End If
End If
Next
End If


ActiveCell.Offset(1, 0).Select
Loop


End Sub


-------------------


I'll take a look at yours and see if you're doing something clevere
than me.

Thanks

--
Mary
-----------------------------------------------------------------------
Mary M's Profile: http://www.excelforum.com/member.php...fo&userid=3263
View this thread: http://www.excelforum.com/showthread.php?threadid=52445