+ Reply to Thread
Results 1 to 10 of 10

Highlight Duplicates on same row

  1. #1
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    409

    Highlight Duplicates on same row

    Can I get some assistance here.

    So, on my attachment, on the tab named start, I receive a file with thousands of rows.
    I want to look at column D and if the name repeats on the next row, then look over at column B and if the dates are the same for both rows, then highlight these two cells in each column.

    The tab named "end result" is what I am looking for.
    I want a formula and a VBA solution if possible, but prefer a VBA solution.

    Thanks
    Attached Files Attached Files
    ==========
    Bigroo1958
    Austin, Texas
    ==========

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,968

    Re: Highlight Duplicates on same row

    Via formula, you would need this CF rule for columns B and D

    =COUNTIFS($B$2:$B$31,$B2,$D$2:$D$31,$D2)>1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Highlight Duplicates on same row

    VBA Solution.
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Highlight Duplicates on same row

    Quote Originally Posted by AliGW View Post
    Via formula, you would need this CF rule for columns B and D

    =COUNTIFS($B$2:$B$31,$B2,$D$2:$D$31,$D2)>1
    Unfortunately, COUNTIFS wouldn't work as his date value contains different time values.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,968

    Re: Highlight Duplicates on same row

    I've just noticed that!!!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Highlight Duplicates on same row

    Quote Originally Posted by bigroo1958 View Post
    The tab named "end result" is what I am looking for.
    If you want the consecutive pairs as your result.
    Please Login or Register  to view this content.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Highlight Duplicates on same row

    With a CF formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this ‼


    Quote Originally Posted by bigroo1958 View Post
    […] but prefer a VBA solution.
    According to your attachment a tiny starter demonstration :

    PHP Code: 
    Sub Demo1()
                 
    Dim Rw As Range
        With Sheets
    ("Start").[A1].CurrentRegion.Rows
            
    For Each Rw In .Item("3:" & .Count)
              If 
    Fix(Rw.Cells(2).Value2) = Fix(Rw.Cells(2)(0).Value2Then _
                  
    If Rw.Cells(4).Value2 Rw.Cells(4)(0).Value2 Then Rw(0).Range("B1:B2,D1:D2").Interior.Color vbYellow
            Next
        End With
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !
    Last edited by Marc L; 07-30-2019 at 10:36 AM. Reason: optimization with jindon range tip …

  9. #9
    Forum Contributor
    Join Date
    11-27-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    409

    Re: Highlight Duplicates on same row

    Thank you all for the very quick solutions to my request, it is very much appreciated.
    All the solutions work nicely and provide me the results wanted.

    I am in the process of learning more on VBA and it was nice to see the different code examples.
    Thanks

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Highlight Duplicates on same row

    You're welcome & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Highlight Duplicates between Sheet1 and Sheet2, ignoring duplicates already in Sheet1
    By KariSaga in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-04-2019, 05:06 AM
  2. [SOLVED] Is it possible to highlight the every second duplicates
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2017, 03:11 AM
  3. [SOLVED] Highlight Duplicates
    By markusvirus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-29-2015, 09:42 AM
  4. highlight duplicates
    By dulitul19 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-05-2013, 06:34 AM
  5. Highlight Duplicates
    By bopsgtir in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-17-2012, 10:17 AM
  6. Macro to check for duplicates and highlight duplicates
    By obc1126 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-23-2008, 09:55 PM
  7. Highlight duplicates
    By SITCFanTN in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2006, 06:25 AM

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