+ Reply to Thread
Results 1 to 6 of 6

Delete duplicate rows between sheets

  1. #1
    Registered User
    Join Date
    04-27-2015
    Location
    Perth
    MS-Off Ver
    office 2010
    Posts
    76

    Delete duplicate rows between sheets

    Excel has the data in sheet1 & sheet2 from column A to column E.

    I need a macro(VBA) that can -

    1. Find duplicate rows between sheets and if it finds duplicate rows than it just deletes them in sheet2.

    2. Find duplicate rows between sheets and if it finds duplicate rows than it just deletes them in both sheets.

  2. #2
    Registered User
    Join Date
    11-01-2012
    Location
    Cairo, Egypt
    MS-Off Ver
    MS Office 2013
    Posts
    76

    Re: Delete duplicate rows between sheets

    Kind of clumsy code, But it will do the job
    (I appreciate if any of forum's Experts provide enhancements to the code...)

    Part 1: Delete Duplicates from Sheet2 Only.
    Please Login or Register  to view this content.
    Part 2: Delete Duplicates from Both Sheets
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Delete duplicate rows between sheets

    A different approach.
    - vba code assumes that there are no duplicate rows within individual sheets
    - message at end tells you which rows have been deleted
    - works for any number of columns

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by kev_; 11-27-2016 at 05:52 PM.

  4. #4
    Registered User
    Join Date
    04-27-2015
    Location
    Perth
    MS-Off Ver
    office 2010
    Posts
    76

    Re: Delete duplicate rows between sheets

    Hi subverter & Kev. Your code is working good. But I forgot to mention that row 1 is header in both sheets. So How to skip that first row.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240
    My code shouldy already be giving you what you need

    For a1 = r1 to 2 Step -1 stops when a1 = 2
    And
    Do until a2 = 2 does the same

    If for any reason it is not doing that, then amend the heading in Column A in either sheet and VBA will not find a match when it checks those first cells against each other!

  6. #6
    Registered User
    Join Date
    04-27-2015
    Location
    Perth
    MS-Off Ver
    office 2010
    Posts
    76

    Re: Delete duplicate rows between sheets

    Got it now. Thank you kev.

+ 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 rows based on duplicate cell, but leaving first and last duplicate.
    By LadyNicole in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 05:07 AM
  2. VBA helps needed to Sum duplicate values and delete duplicate rows
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2013, 11:40 PM
  3. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  4. sum multiple sheets and delete duplicate rows
    By Farida in forum Excel General
    Replies: 1
    Last Post: 06-05-2012, 01:14 PM
  5. Delete duplicate rows and associated sheets
    By fatalcore in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-05-2012, 10:31 AM
  6. Compare 2 sheets and delete duplicate rows
    By Gavlar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-26-2011, 01:34 AM
  7. Compare to Sheets and Delete Duplicate Rows...
    By BossWebmaster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-24-2008, 11:19 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