+ Reply to Thread
Results 1 to 3 of 3

Macro to Highlight Duplicates and add Duplicate text at a column

  1. #1
    Registered User
    Join Date
    07-15-2016
    Location
    California
    MS-Off Ver
    2010
    Posts
    1

    Macro to Highlight Duplicates and add Duplicate text at a column

    Hi,

    I have a excel will below data, it will identify the set of repeated numbers and seperate a line on each set. That is working fine so far, but i need to add one more Inputbox and allow user enter the column to check for duplicates.
    So that i will check for duplicates in each set and highlight with color and add text "duplicate" at last column.

    Data:

    13 D29
    13 D29
    13 D3
    14 D3
    14 D85
    15 D78
    15 D78
    15 D78

    It will identify 13 as on set and add a new empty line and similar to 14 and 15 as below.

    13 D29
    13 D29
    13 D3

    14 D3
    14 D85

    15 D78
    15 D78
    15 D78

    Now it has to identify duplicates in each set and highlight and add duplicate text.

    13 D29
    13 D29 Duplicate
    13 D3

    14 D3
    14 D85

    15 D78
    15 D78 Duplicate
    15 D78 Duplicate

    Below is the code i tried..

    Please Login or Register  to view this content.
    I am not able to identify duplicates and highlight. Can someone please help..?

    Thanks
    Sanjay

  2. #2
    Registered User
    Join Date
    05-06-2014
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    43
    I'm not in the best of circumstances to write and review code but would you be open to doing this with conditional formatting? You could have it use the formula option in conditional formatting and use a countifs statement. If(countifs>1,1,0) that should work if it will stay in the file and not need to be triggered. Sorry about being on mobile, but that's a rough alternative. Cheers!
    ADD REPUTATION below the posts to say thanks!

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

    Re: Macro to Highlight Duplicates and add Duplicate text at a column

    Try this
    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)

Similar Threads

  1. Replies: 1
    Last Post: 08-28-2015, 01:01 PM
  2. vba to ONLY highlight contiguous duplicates in one column
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-23-2014, 04:59 PM
  3. Compare Column A to Column B then highlight/format any duplicates
    By BigExcelBaby in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2014, 06:51 PM
  4. [SOLVED] Need a macro to highlight Rows that contain a duplicate for each column of a data range
    By MoHassan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2013, 05:39 AM
  5. [SOLVED] Macro to find column with duplicates, for each of those check another column for duplicate
    By MaartenKoller in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-17-2013, 10:09 AM
  6. Need Macro which identifies duplicates in a column and colors the duplicate values
    By Karthik Sen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2012, 01:59 PM
  7. 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

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