+ Reply to Thread
Results 1 to 6 of 6

Extracting data in groups of 3's and copying to another worksheet

  1. #1
    Registered User
    Join Date
    09-23-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Extracting data in groups of 3's and copying to another worksheet

    Hi All,

    New to this forum and Excel/VBA and could really do with some help!

    I have the a table set up like the following:

    Excel Forum Pic.png

    The problem I have is that I need a Macro to extract data in sets of 3's and only if they have the same
    concatenated figure i.e. in column E.

    For the example attached then I would want Assignment 4,5,6 to be taken out (7,8 left as although these are the same concatenated number there are only two of them) then I'd want 9,10,11 and 12,13,14 (15,16 would be ignored etc).

    I'm guessing I might need a loop and an array but not a clue how to go about this?

    I have used the following code previous to extract and copy some data but it is limited by a user having to input a variable (not dynamic) and I get
    get the list to look at blocks of 3.

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by Cutter; 09-23-2012 at 03:49 PM. Reason: Added code tags

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Extracting data in groups of 3's and copying to another worksheet

    This will delete rows until there are multiples of 3 which you can use on a copy of the data

    Please Login or Register  to view this content.
    Martin

  3. #3
    Registered User
    Join Date
    09-23-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Extracting data in groups of 3's and copying to another worksheet

    Hi Martin,

    Thanks Brilliant!! Thanks for that. Much Appreciated.

    Just 2 quick things...

    Is there any way to copy keep the deleted rows? I could do with retaining these.

    Once I have removed the duplicate rows is there a way to give a each set of 3's a new assignment number common to both?

    Thanks,

    Superb help

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Extracting data in groups of 3's and copying to another worksheet

    This mod will copy the deleted rows to the second sheet.

    Please Login or Register  to view this content.
    Sorry but didn't understand the assignment number one.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Extracting data in groups of 3's and copying to another worksheet

    @ Tony Morgan

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.

  6. #6
    Registered User
    Join Date
    09-23-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Extracting data in groups of 3's and copying to another worksheet

    Sorry Martin,

    My apologies, still getting used to describing some of this stuff - lol

    I'll have another go....

    Once I have removed the duplicate rows and I'm left with data in blocks of threes, if there a way I can give each block of three
    a unique id? i.e. I could rename assignments 4,5,6, to 1 and then the next block in the sequence 9,10,11 to 2 etc

    Lastly, is it possible to reverse the way duplicate rows are removed i.e. the duplicates are left on the original page and the non-duplicates (blocks of 3) are removed to another page instead?

    Thanks again for all your help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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