+ Reply to Thread
Results 1 to 8 of 8

Highlight column matches

Hybrid View

  1. #1
    Registered User
    Join Date
    01-18-2012
    Location
    meniha nre
    MS-Off Ver
    Excel 2003
    Posts
    9

    Question Highlight column matches

    Hi folks,

    I'd appreciate any help on this as I am a novice and really don't want to do this manually!

    I have a spreadsheet with over 100 rows and 100 columns. I want to highlight any columns which contain the exact same values. The entire column needs to be identical to the other highlighted column. So for example:

    If Column A is the exact same as Column B and Column D then highlight all of the columns in orange.
    If Column F and Column C contain the same values then highlight all of the columns in brown.
    If Column G does not have a match then don't highlight.

    An example of what I mean is attached.

    Thanks for any help,
    Thanks,
    Joe
    Attached Files Attached Files
    Last edited by joeyga; 05-02-2013 at 04:36 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Highlight column matches

    Hi Joe

    There are lots of ways of doing this

    The simplest is conditional formatting.

    We can turn any cell that is the came as column a orange
    and any cell that is the same as column c brown

    is that what you need?
    Attached Files Attached Files
    Last edited by mehmetcik; 05-02-2013 at 06:45 PM.

  3. #3
    Registered User
    Join Date
    01-18-2012
    Location
    meniha nre
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Highlight column matches

    Hey,

    Cheers for the reply, but I don't think that is what I need. I don't want to highlight individual cells that contain the same value in other columns. I want to highlight a column, when the entire column is exactly identical to another column. Matching columns need to be highlighted in the same colour.

    Thanks,
    Joe

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Highlight column matches

    Ok

    I now understand your requirement.

    Bear with me.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Highlight column matches

    Hi

    The attached file has a macro that will paint column b and any duplicate column green if there are duplicates.

    Is that the sort of thing you need?

    Please advise so that I can extend the macro for you tomorrow
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-18-2012
    Location
    meniha nre
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Highlight column matches

    Hi,

    Thanks for your help here. That's exactly the sort of thing I need. It now needs to be extended to highlight any other matching columns (e.g. D&F) in a different colour.

    Thanks again,
    Joe

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Highlight column matches

    Hi

    I have modified the Macro

    You can now have six different sets of matching columns and they will be colour coded in six different colors.

    Enjoy.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Highlight column matches

    just for your amusement
    Sub samecolumns()
    
    Dim a(), b As Object, c, d, e As Long
    
    Set b = CreateObject("scripting.dictionary")
    With Cells(1).CurrentRegion
    ReDim a(1 To .Columns.Count)
    For Each d In .Columns
        c = Join(Application.Transpose(d), Chr(2))
        If Not b.exists(c) Then
            b(c) = b.Count + 1
            a(b(c)) = .Columns(d.Column).Address(0, 0)
        Else
            a(b(c)) = a(b(c)) & ", " & .Columns(d.Column).Address(0, 0)
        End If
    Next d
    End With
    
    For Each d In a
        If InStr(d, ", ") > 0 Then
            e = e + 1
            Range(d).Interior.ColorIndex = e + 2
        End If
    Next d
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1