+ Reply to Thread
Results 1 to 4 of 4

Delete Entire Row on duplicate values from multiple columns

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Kuching, SARAWAK
    MS-Off Ver
    Excel 2010
    Posts
    116

    Delete Entire Row on duplicate values from multiple columns

    Hi,
    Been trying to find the macro that really delete entire row when it finds duplicate values in the selected columns defined in the macro. Below I found to be able to delete on the cells but not entire row. And the deleted of cells have cleared out my formattings and validation lists on the affected cells, making them totally empty/blanks. If delete entire rows on duplicates, this will allow users to no longer see the blank spaces between the last row with data and the next row with the formattings and validations lists.

    Below is what I found so far but not entirely end results as I wish. Appreciate experts to help for entire row. Thank you in advance.

    Sub DeleteDuplicates()

    With ActiveSheet
    Set Rng = Range("A1", Range("B1").End(xlDown))
    Rng.RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
    End With

    End Sub

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Delete Entire Row on duplicate values from multiple columns

    Try this....

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Delete Entire Row on duplicate values from multiple columns

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Please go to your first post --> Edit Post --> Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

  4. #4
    Forum Contributor
    Join Date
    06-18-2012
    Location
    Kuching, SARAWAK
    MS-Off Ver
    Excel 2010
    Posts
    116
    Quote Originally Posted by sktneer View Post
    Try this....

    Please Login or Register  to view this content.
    Hi sktneer,
    Thank u for the swift response. However, ur code still did not able to retain the formattings and validation lists after deleting the duplicates.

+ 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] Delete entire row if one column contains duplicate values
    By dawsonsoo in forum Excel General
    Replies: 4
    Last Post: 08-26-2014, 09:55 AM
  2. Macros to delete entire duplicate row for duplicate values
    By cutelebel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2014, 12:09 PM
  3. [SOLVED] If multiple columns are blank, delete entire row
    By steven_e in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2013, 04:18 PM
  4. Delete duplicate values from entire sheet
    By arunjones in forum Excel General
    Replies: 2
    Last Post: 12-10-2012, 04:45 PM
  5. Macro to delete entire rows based values in columns
    By shamade2107 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2009, 11:17 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