+ Reply to Thread
Results 1 to 6 of 6

Excel 2012, Help With Highlighting Specific Rows

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Excel 2012, Help With Highlighting Specific Rows

    Hi everyone! I just discovered this community. I hope someone can help me out with this:


    I have a table of data in which I'm trying to highlight the rows that have common entries for one column (Column A) and different entries for another column (Column C).

    For example, if row 6 has 'Erik' in column A and '72' in column C, and if row 426 has 'Erik' in column A and '3' in column C, I want to highlight row 6 and row 426.

    Does anyone know if/how I'd be able to do this?

  2. #2
    Registered User
    Join Date
    12-22-2011
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Excel 2012, Help With Highlighting Specific Rows

    Highlight the entire spreadsheet (ctrl+A), Go to Conditional Formatting, New Rule, Use a formula to determine which cells to format, type the formula =$A1="Erik", go to format, go to the fill tab, choose your highlight color, click OK, and click OK.
    This will work if your "Erik" cells are all under column A. If not, you need to create the rule again for the other columns where it may appear.

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Excel 2012, Help With Highlighting Specific Rows

    Thanks, that worked.

    Do you know if there's a way to do this for values I don't know as well? I mean, if I have multiple different values that occur in Column A that are repeated (with different corresponding values in Column B) can I highlight all such rows?

    For example, in addition to row 6 and row 426, row 17 and row 890 share the same value in column A but have different values in column B. If I don't know the value in Column A that I'm looking for, is there a way to still highlight these rows?

    I'm trying to incorporate this action into a macro so I can use it on future data of the same format.

  4. #4
    Registered User
    Join Date
    12-22-2011
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Excel 2012, Help With Highlighting Specific Rows

    I am not aware of any method that would satisfy that. Maybe someone else out there could chime in??

  5. #5
    Registered User
    Join Date
    05-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Excel 2012, Help With Highlighting Specific Rows

    Hey, thanks for your help. Somebody helped me with the VBA coding I could use to perform that task.
    If you're interested, here it is...


    Sub Task1()
    Dim Rng As Range
    Dim Dn As Range
    Dim Fd As Boolean
    Dim Q
    Dim t
    Dim p
    Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
    With CreateObject("scripting.dictionary")
    .CompareMode = vbTextCompare
    For Each Dn In Rng
    Fd = False
    If Not .Exists(Dn.Value) Then
    .Add Dn.Value, Array(Dn, Fd, Dn)
    Else
    Q = .Item(Dn.Value)
    If Not Q(2).Offset(, 2).Value = Dn.Offset(, 2) Then Q(1) = True
    Set Q(0) = Union(Q(0), Dn)
    .Item(Dn.Value) = Q
    End If
    Next
    Dim K
    For Each K In .keys
    If .Item(K)(1) = True Then
    .Item(K)(0).EntireRow.Interior.ColorIndex = 35
    End If
    Next K
    End With
    End Sub

  6. #6
    Registered User
    Join Date
    05-30-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Excel 2012, Help With Highlighting Specific Rows

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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