• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Excel Question (Macro, Vlookup, other method?): Same name highlighting

max347

Platinum Member
Hi guys, I have a column of names in A column, and a column of names in B column. I need to highlight (or put into a third column) the duplicates. The catch- one column is in "first last" format and the other is in "last, first" format.

Ideas?

Thanks!
 
Assuming clean formatting of the names, can you break up one of the columns using Text-to-Column, then recombine them to match the other column's format (using Concatenate or simply using "&" functions)?

Once you have the 2 columns matching in format, you can use the "if" function in column C to highlight any matching rows, e.g. IF(A2=B2,"DUPLICATE","").
 
Last edited:
Unfortunately the one column is severely non-formatted. ie, different spacing, some have jr, sr, ms, etc.

I will check out this method and see what I can come up with however.

I was checking out the fuzzy sort thing by microsoft however it just seems like a way to do database style tie-togethers...not really a sort.
 
Yeah so this is what I was trying to use, but unfortunately it won't work with "similar" names, just exact matches-

Code:
Sub ColorDuplicates()
'Color duplicate items between columns A and B
    For i = 1 To Range("B65536").End(xlUp).Row
         If Application.WorksheetFunction.CountIf(Range("A:A"), Range("B" & i)) = 1 Then
            With Range("B" & i).Font
                .ColorIndex = 3
                .Bold = True
            End With
         End If
    Next i
    For i = 1 To Range("A65536").End(xlUp).Row
         If Application.WorksheetFunction.CountIf(Range("B:B"), Range("A" & i)) = 1 Then
            With Range("A" & i).Font
                .ColorIndex = 3
                .Bold = True
            End With
         End If
    Next i
End Sub
 
Back
Top