two identical names in different columns in Excel

Pauls123

Board Regular
Joined
Mar 22, 2011
Messages
180
Hi all,

I have a simple spreadsheet where in two of the colums have names in them. Column E and column L. A certain name may appear just the once in both of the columns, no more than once.

I want to highlight/find the names that appear in both columns?

Any suggestions please

Paul
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi Jon,

Thanks for your reply. There may be heaps of similar names, not just the one name. But a name would only appear the once in both columns. Not sure if that would work in conditional formatting?

Paul
 
Upvote 0
Conditional formatting will work very well in this case. Just select both columns (use Ctrl+click if necessary) and follow the instructions in the link above under the first heading - "Highlight duplicate values with color".
 
Upvote 0
Code:
Sub Maybe()
Dim c As Range
    For Each c In Range("E2:E" & Cells(Rows.Count, 5).End(xlUp).Row)
        If Application.WorksheetFunction.CountIf(Range("L:L"), c.Value) > 0 Then c.Interior.Color = vbRed
    Next c
End Sub
 
Upvote 0
Hey Jon, That is brilliant, I didnt realise you could do a conditional formatting for two separate columns. Excellent. And also thanks Jolivanes. Your formula is a bit too advanced for me.

Thanks again, Paul
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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