+ Reply to Thread
Results 1 to 4 of 4

highlight duplicate rows and delete based on highest value from column

Hybrid View

  1. #1
    Registered User
    Join Date
    04-10-2015
    Location
    pune
    MS-Off Ver
    7
    Posts
    5

    Cool highlight duplicate rows and delete based on highest value from column

    Hi,
    i want VBA to
    1)highlight duplicate rows based on Column A and column B.
    2)and delete row between duplicates based on highest value between them from (column C)
    my Data contains:
    Date ID Value
    03/02/15 MC 1797 10
    03/02/15 MC 1728 12
    03/02/15 MC 1404 13
    03/02/15 MC 1797 17

    i want VBA to highlight row1 and row4.and after that delete row4 because of highest value.

    please help ASAP.
    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: highlight duplicate rows and delete based on highest value from column

    Hi,

    Please find the below VBA code which will help to delete the duplicate rows:-

    Sub duplicate()
    Dim rng As Range
    Lastrow = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
    With ActiveSheet
        Set rng = Worksheets("Sheet1").Range("A1:C" & Lastrow)
        rng.RemoveDuplicates Columns:=3, Header:=xlYes
    End With
    Thanks
    Nisha Dhawan


    If you like my answer please click on * Add Reputation
    "If you can dream it, You can do it "

  3. #3
    Registered User
    Join Date
    04-10-2015
    Location
    pune
    MS-Off Ver
    7
    Posts
    5

    Re: highlight duplicate rows and delete based on highest value from column

    Hi
    Nisha Thanx for your help,but code is not working.can u please check it once.

  4. #4
    Valued Forum Contributor
    Join Date
    05-07-2014
    Location
    India
    MS-Off Ver
    MS Office 365
    Posts
    313

    Re: highlight duplicate rows and delete based on highest value from column

    Hi,

    While applying this code please make sure that worksheet name and data range should be according to your data.

+ 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. Delete rows based on highest value
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2014, 09:44 AM
  2. Highlight duplicate rows based on column A but be case sensitive
    By theblade24 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-18-2013, 06:14 PM
  3. Replies: 3
    Last Post: 06-27-2012, 10:12 PM
  4. Replies: 0
    Last Post: 07-22-2011, 12:11 PM
  5. Replies: 5
    Last Post: 05-29-2006, 09: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