Finding any words from B1:B400 within A1:5000

ezharris

New Member
Joined
Jun 12, 2009
Messages
1
Take a look at whiat I am trying to do, any input would be appreciated! (keep scrolling down, i dont know how i got all that extra space! LOL):biggrin:
<TABLE border=1>
<TBODY><TR>
<TH>CONTRIBUTORS</TH>
<TH>LAST NAMES</TH>









</TR>

<TR>
<TD>JOHN PAUL GLADSTONE</TD>
<TD>PETERSON</TD><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>









</TR>

<TR>
<TD>RALPH JONES</TD>
<TD>MURPHY</TD>







</TR><o:p></o:p>

<o:p></o:p>
</TR>
<TR>
<TD>ANGELA F. LOGGINS</TD>
<TD>JONES</TD>









</TR>


<o:p></o:p>
<o:p></o:p>
</TR>





<TR>

<TD>STACEY GIBBENS-STERN</TD>
<TD>STONE</TD>









</TR>


<o:p></o:p>
<o:p></o:p>
</TR>





<TR>

<TD>JO ANNE MC DERMOTT</TD>
<TD>KOHLER</TD>









</TR>


<o:p></o:p>
<o:p></o:p>
</TR>





<TR>

<TD>WOLFRAM & HART, LLC.</TD>
<TD>STEPHENS-LOGGINS</TD>









</TR>

















</TABLE>



column 1 has a list of names that are not all 'first last' names (cant split up)

Column 2 contains a list of last names only (unique vaules). I am trying to somehow find similarities between the two lists, Ideally, I would like to highlight the common names from column2 in column 1.
I am not too versed in VBA, but am willing to give it a shot if what I am trying to accomplish cannot be done with formulas alone.
Also, if possible, in the instance of GLADSTONE and STONE, i would prefer that not be 'marked'. but can deal with it if needed. (my full list of column 1 is about 5000 names, and I also have an identifier next to each name in a seperate column)

THANK YOU IN ADVANCE FOR ANY INSIGHT!!!! :)
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
see sheet 1 below which is your database
the entries in column B is copied in column A of sheet2(sheet 2 also is given below)
now run this macro and see what happens . see both sheet 1 and sheet2. what you see in sheet 1 and sheet 2 are after running the macro test. you can rerun the macro test.

there are two macroS test, undo. the macro "undo" in embedded in macro "test"
You have to copy paste both the macros in the standard module.
and run the macro "test" ONLY

POST FEEDBACK
The macro is

Code:
Sub TEST()
Dim rng As Range, c As Range, cfind As Range
undo
On Error Resume Next
With Worksheets("sheet2")
Set rng = Range(.Range("a2"), .Range("a2").End(xlDown))
For Each c In rng
With Worksheets("sheet1").Columns("a:a")
Set cfind = .Cells.Find(what:=c.Value, lookat:=xlPart)
If Not cfind Is Nothing Then
cfind.Interior.ColorIndex = 3
cfind.Copy c.Offset(0, 1)
End If
End With 'sheet1 column A
Next
End With 'sheet 2
End Sub


Code:
Sub undo()
Worksheets("sheet1").Cells.Interior.ColorIndex = xlNone
Worksheets("sheet2").Columns("B:B").Delete
End Sub

ezharris.xls
ABCD
1CONTRIBUTORSLASTNAMES
2JOHNPAULGLADSTONEPETERSON
3RALPHJONESMURPHY
4ANGELAF.LOGGINSJONES
5STACEYGIBBENS-STERNSTONE
6JOANNEMCDERMOTTKOHLER
7WOLFRAM&HART,LLC.STEPHENSLOGGINS
Sheet1


ezharris.xls
ABCD
1LASTNAMES
2PETERSON
3MURPHY
4JONESRALPHJONES
5STONEJOHNPAULGLADSTONE
6KOHLER
7STEPHENSLOGGINS
8
Sheet2
 
Upvote 0
assumng data is in a2:b??

Excel Workbook
AB
2JOHN PAUL GLADSTONEPETERSON
3RALPH JONESMURPHY
4ANGELA F. LOGGINSJONES
5STACEY GIBBENS-STERNSTONE
6JO ANNE MC DERMOTTKOHLER
7WOLFRAM & HART, LLC.STEPHENS-LOGGINS
Sheet2
Excel Workbook
CD
2  
3 Match A
4Match B 
Sheet2
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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
Back
Top