+ Reply to Thread
Results 1 to 3 of 3

Move Duplicates from Sheet1 to Sheet2

  1. #1
    Registered User
    Join Date
    11-26-2015
    Location
    Bradford, England
    MS-Off Ver
    Microsoft excel 2010
    Posts
    13

    Smile Move Duplicates from Sheet1 to Sheet2

    Hi,
    I’m new to Macros and I was wondering if anyone could please help me with VBA code for the following:

    I have one workbook with two sheets which I will call Sheet1 and Sheet2

    In Sheet1 there is data with an in definitive end point (i.e. the data will be copied and some weeks the data might be 100 rows, other weeks 200 rows).

    A simplistic example of the data might look something like this:
    Reference Solicitor Name Postcode
    A11111 Alfies XXX ZZZ
    B22222 Simons YYY ZZZ
    C22222 Freds ZZZ ZZZ
    A11111 Fionas KKK LLL
    D22222 Dericks MMM NNN
    C22222 Lisas III JJJ

    There may be duplicates/ triplicates in column A – Sheet1 (Reference). Column A will not necessarily be sorted A-Z.
    There will be 16 columns in sheet1 (A to P)
    What I need to do is:
    a) Copy all column headers (row A) from Sheet 1 to Sheet 2
    b) Search column A (Sheet1) for duplicate entries (Duplicate entries in other columns are not a concern)
    c) Once duplicate entries are located in column A (Sheet1), cut and paste the full row from Sheet1 to Sheet2 in row 2 downwards (Hence removing both sets of duplicates from column A - Sheet1 and retaining the headers copied in stage a)
    d) Sort column A in Sheet2 by A-Z
    e) Ensure there are no gaps on Sheet1 where entries have been removed.
    f) Sort column A in Sheet1 by A-Z
    The result using the above example would show:

    Sheet1
    Reference Solicitor Name Postcode
    B22222 Simons YYY ZZZ
    D22222 Dericks MMM NNN

    Sheet 2
    Reference Solicitor Name Postcode
    A11111 Alfies XXX ZZZ
    A11111 Fionas KKK LLL
    C22222 Freds ZZZ ZZZ
    C22222 Lisas III JJJ

    Any help would be greatly appreciated!

  2. #2
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Move Duplicates from Sheet1 to Sheet2

    Try this one

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-26-2015
    Location
    Bradford, England
    MS-Off Ver
    Microsoft excel 2010
    Posts
    13

    Re: Move Duplicates from Sheet1 to Sheet2

    Wow! Works perfectly! Thanks so much! Next stage is for me to try and break it down and teach myself!

+ 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] Move Row from sheet1 to sheet2 depending on colour. Thanks :)
    By fawnlemur in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2015, 04:10 AM
  2. Copy row from Sheet1 to Sheet2 when cell = Yes w/o duplicates
    By acard0521 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2014, 03:29 PM
  3. move data from sheet1 to sheet2 based on date in column1 of sheet1
    By pcaldwell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2014, 03:20 PM
  4. Replies: 6
    Last Post: 07-25-2013, 02:58 PM
  5. Replies: 1
    Last Post: 03-22-2012, 04:08 AM
  6. need to sum up in sheet2 and move all the date from sheet2 to sheet1
    By vijay1153 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2012, 01:16 PM
  7. [SOLVED] Move Records from Sheet1 to Sheet2
    By Jim May in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2005, 12:05 AM

Tags for this Thread

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