View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
jindon jindon is offline
external usenet poster
 
Posts: 1
Default comparing 2 columns


Hi,

UDF

Use like in cell
=wfind(A1,B$1:B$10)


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

Function wfind(r As Range, rng As Range) As String

Dim c As Range, txt1, txt2, flag As Boolean
txt1 = Split(r, " "): flag = False
For Each c In rng
txt2 = Split(c, " ")
For i = LBound(txt1) To UBound(txt1)
If Trim(txt1(i)) Like Trim(txt2(i)) & "*" Then
flag = True
Else
flag = False
End If
Next
If flag = True Then
wfind = r & " Found": Exit Function
End If
Next
wfind = r & " not found"

End Function

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

--
jindo
-----------------------------------------------------------------------
jindon's Profile: http://www.excelforum.com/member.php...fo&userid=1313
View this thread: http://www.excelforum.com/showthread.php?threadid=37501