+ Reply to Thread
Results 1 to 5 of 5

Macro that can sort and copy groups of data into separate spreadsheets

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Macro that can sort and copy groups of data into separate spreadsheets

    In my attached spreadsheet I have a list of data in Column A of Sheet1 and I need a macro that can do the following:

    1. Sort the data in Column A of Sheet1.
    2. Find the all the data that matches exactly in Column A of Sheet 1.
    3. Copy and paste each group of matches one by one to Sheet2.
    4. Saving a new spreadsheet after each paste.

    So basically the end result will be a different spreadsheet saved for each group of matches.
    For example, On my spreadsheet I have 4 different groups. So I should have 4 different spreadsheets listing the rows on sheet2 of each spreadsheet.
    The group names in Column A can be used as the sheet names.

    Thanks
    Attached Files Attached Files
    Last edited by glide2131; 12-12-2014 at 03:13 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro that can sort and copy groups of data into separate spreadsheets

    There is a possibility you've dumbed down the sample file too far.

    I read that you are wanting to parse the rows of data from Sheet1 to new sheets in the workbook taking all the matching rows in column A.

    'SHEET1 TO MANY SHEETS
    Here's a macro for parsing rows of data from one sheet to many sheets named for the same values in a specific column.It not only can parse the rows, it can create the sheets if they are missing. There is a sample sheet there where you can test this out.


    Notice that row1 must be a title row, then the data starts in row2 and goes down as far as you'd like.
    Last edited by JBeaucaire; 12-26-2019 at 04:25 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Macro that can sort and copy groups of data into separate spreadsheets

    Thank you for your reply. That code works great except for one item. I need to save each group individually instead of sending them or pasting them to their own sheet within the same workbook. Do you know how to do that?
    So for example, if I had 4 groups this code would create 4 new sheets and save each group in each. What I need is to copy each group into a new sheet and then save it under a new name. So the end result will be 4 different workbooks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro that can sort and copy groups of data into separate spreadsheets

    Surprised you didn't find this there on the same site:

    'ONE SHEET to WORKBOOKS (1)
    Here's a macro for taking a sheet with data and creating individual wbs from each unique value in a chosen column. The date is added to the workbook names to give a reference as to when the wbs were created.
    Last edited by JBeaucaire; 12-26-2019 at 04:25 PM.

  5. #5
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Macro that can sort and copy groups of data into separate spreadsheets

    Ok. that worked. Sorry about that. Thanks again.

+ 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] Macro to copy 3 adjacent columns at a time to a separate worksheet & sort by Company name
    By anya1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-20-2013, 06:50 AM
  2. Replies: 1
    Last Post: 10-10-2012, 11:35 AM
  3. Macro/Script for Moving Groups of Data in to Separate Columns
    By JustinSxcel in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 07-05-2012, 01:56 AM
  4. Separate the data from a table based on certain groups
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2009, 02:40 PM
  5. Separate Table Data and List Groups in Rows
    By Scott.h in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2008, 07:57 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