comparing 2 columns with text

dmasvar

New Member
Joined
Nov 17, 2004
Messages
33
is there a way of comparing two colunms of text say and drawing out the similiarities, wehther exact match or partial match...

would appreciate any assistance..
eg

one column may have

cat, camp

and 2nd column could have

cake, cow

the output column 3rd column

if i ask to match "ca" it should say there is a match and bring out cat, cake camp


is this possible how do i do it.. sql?expresison builder?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

venkat1926

Well-known Member
Joined
Aug 21, 2005
Messages
4,824
if you have not got already the solution here is thes SUB to run
(may not be very elegant)

introduce a first row blank

in the input box window type the words
ca
and clikc ok(or hit <enter>)



Public Sub test()
Dim findc As Range
Dim firstadd As String
Dim x As String
Dim y As String
Range("a5").Delete

x = InputBox("type string part")
With Worksheets("sheet1").Range("a1:B4")

Set findc = Cells.Find(what:=x, lookat:=xlPart)
If Not findc Is Nothing Then
y = findc.Value
firstadd = findc.Address
''msgbox firstadd


End If
Do
Set findc = .FindNext(findc)
If findc.Address = firstadd Then GoTo line1

''msgbox findc.Address
y = y & " " & findc.Value
Loop While findc.Address <> firstadd
End With
line1:
Range("a5") = y
''msgbox "macro over"
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,129,685
Messages
5,637,808
Members
416,983
Latest member
LessThanAverageUser

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top