+ Reply to Thread
Results 1 to 2 of 2

Vba to highlight the cell and remove duplicates

  1. #1
    Registered User
    Join Date
    02-05-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    1

    Vba to highlight the cell and remove duplicates

    Vba to highlight the cell and remove duplicates



    HI
    I need a help in preparing a macro which identify the duplicate in column C of sheet1 followed by removing old row and retain new row but before deletion of old row i wish to highlight the cell in color red of new row (which is retained after duplicate remove) where values has changed between duplicate old row and new row.
    if possible also that changed value insert as comment in new row cell in same column.

    Now i am using this macro to identify the duplicate and remove old entries
    Sub Delete_Dups_Keep_Last()
    Dim i As Long
    Dim j As Long
    Worksheets("Sheet1").Activate
    Dim ROW_DELETED As Boolean
    i = 2 'start on second row
    Application.ScreenUpdating = False
    Do While i <= Sheets("Sheet1").UsedRange.Rows.Count
    ROW_DELETED = False
    For j = i + 1 To ActiveSheet.UsedRange.Rows.Count
    If Cells(i, 3) = Cells(j, 3) Then
    Rows(i).Delete
    ROW_DELETED = True
    Exit For
    End If
    Next j
    If Not ROW_DELETED Then i = i + 1
    Loop
    Application.ScreenUpdating = True
    End Sub

    In sheet 1 row 3 and row 9 having duplicate value in column C and wish to highlight and insert changed value as a comment in row 9.

    test.png

    Thanks in Advance

  2. #2
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    880

    Re: Vba to highlight the cell and remove duplicates

    Cross-posted without link
    https://www.mrexcel.com/forum/excel-...uplicates.html
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

+ 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] Remove (or Highlight) name duplicates?
    By maurerjl in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-14-2015, 01:45 PM
  2. Remove Duplicates in a Cell
    By brianmcgee in forum Excel General
    Replies: 13
    Last Post: 12-08-2014, 03:17 PM
  3. Replies: 12
    Last Post: 09-10-2013, 09:45 PM
  4. [SOLVED] Remove duplicates in a single cell
    By SonGoku in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2013, 06:35 AM
  5. Remove duplicates within a cell
    By forzaboro in forum Excel General
    Replies: 16
    Last Post: 08-29-2011, 10:14 AM
  6. Replies: 8
    Last Post: 02-27-2011, 06:46 AM
  7. [SOLVED] Remove highlight background in cell
    By DTTODGG in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-21-2005, 02:35 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