Results 1 to 17 of 17

Macro: Move Duplicate Rows From One Worksheet To Another

Threaded View

  1. #1
    Registered User
    Join Date
    07-04-2014
    Location
    Conroe, TX
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    11

    Macro: Move Duplicate Rows From One Worksheet To Another

    I am using Excel 2007 on Windows 7 Home Premium 64bit.

    I have searched the forum, but have not been able to find an
    example that does exactly what I am trying to do.

    My Workbook contains 2 Worksheets, both with the same headings in row 1.
    Sheet2 is initially empty, except for the headings in row 1.

    I would be grateful to learn how to create a Macro as described below.

    The following is a sample of the data in Sheet1:
         A      B       C            D        E      F
     1 First  Last   Address      City      State  Zip
     2 John	  Smith	 123 Main St  New York  NY     10021
     3 Mary	  Smith	 123 Main St  New York  NY     10021
     4 John	  Smith	 123 Main St  New York  NY     10021
     5 John	  Smith	              New York  NY     10021
     6 Joe	  Smith  123 Main St  New York  NY     10021
     7 Jack	  Smith  123 Main St  New York  NY     10021
     8 John	  Smith  123 Main St  New York  NY     10021
     9 Mary	  Smith  123 Main St  New York  NY     10021
    10 Bill	  Smith               New York  NY     10021
    11 John	  Smith	              New York  NY     10021
    12 John	  Smith  124 Main St  New York  NY     10021
    I want to create a Macro to operate as follows:

    In the above sample data, rows 2, 4, and 8 are identical,
    so I want to copy rows 4 and 8 to Sheet2, and delete them from Sheet1.

    Similarly:
    rows 3 and 9 are identical, so row 9 should move to Sheet2;
    rows 5 and 11 are identical, so row 11 should move to Sheet2.

    Rows 6, 7, 10, and 12 are all unique, so should be unaffected by the Macro.

    New records will be added to Sheet1 periodically, so the Macro will be used
    each time to move any newly discovered duplicates to Sheet2.

    The Macro should make no assumption about how the rows are ordered,
    and should not change their order.

    I have uploaded two Workbooks, such that Workbook1 shows the
    original data, and Workbook2 shows the result I want to obtain.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Move rows with duplicate values in column J to next worksheet
    By theletterh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2013, 10:38 AM
  2. Macro to move rows with specific content to another worksheet
    By Bobbington in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-24-2012, 11:05 AM
  3. Macro to move specific rows from one worksheet to another
    By LaughingLaurie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2012, 02:33 PM
  4. Replies: 1
    Last Post: 02-11-2012, 11:15 AM
  5. move duplicate rows to another worksheet
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-06-2009, 07:36 PM

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