+ Reply to Thread
Results 1 to 6 of 6

Splitting data based on column value

  1. #1
    Registered User
    Join Date
    09-26-2017
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    3

    Splitting data based on column value

    Good morning,

    I work for a manufacturing company, and I've been trying to create a new spreadsheet that will split data of Non-conforming material based on a supplier number into a new sheet. I would also like each new sheet to be in the form of a table. My goal would be to link each table to one slicer that sorts data based on week ending dates. From there, I can email each supplier their own list of non-conforming material for the week.

    I realize that I can accomplish some of this by "Show report filter pages..." pivot table function, but the problem is, this database is refreshed daily, and when a new supplier that hasn't been in our database before shows up, the pivot tables have already been created and there won't be a new page with a new pivot table for the new supplier (My data source for the pivot tables goes the entire length of the columns).

    I have also tried parsing data using the code below, but I find that it only runs effectively one time initially. So if I try to run the macro again, it won't split new data. Also, this code below doesn't do anything with formatting the data/keeping data in table form.

    Please Login or Register  to view this content.
    My columns range from A-S, my columns with the supplier number I want data split by is in column N (VCOL = 14), and my week ending dates are in column Q (VCOL = 17)

    I'm fairly inexperienced with VBA, but I've been resourceful in accomplishing smaller tasks. I'm a bit out of my depth on this apparently.

    Thanks for help!
    Last edited by Ndekk; 09-26-2017 at 12:05 PM.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Splitting data based on column value

    It will take a bit of VBA. You can create a second table with vendor names only and then check to see if a sheet for the vendors exist. If not copy a "template" sheet and name it for the vendor and set the filter. I'll have to see the format of your source data and a sample of what you want the end result to look like.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    09-26-2017
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    3

    Re: Splitting data based on column value

    In between posting and your response, I found that I can't actually link tables using a slicer unless they are on the same worksheet, which is unfortunate. So I guess what I want to accomplish is to have my main data source, which is a connection of another spreadsheet and will be refreshed once a day, to be split into seperate worksheets by vendor number. If possible, I would it to be in pivot table form, that way I can link all the seperate pivot tables with a slicer and filter them by week ending date.

    As I mentioned initially, the show report filter pages function which can be found in pivot table options will accomplish most of this, but once the master pivot table is separated, new pivot tables won't be formed when there is a new vendor that appears in the main data table that wasn't in the data when the first set of pivot tables were created.

    In the file called "Sample of Data", I left 20 lines worth of data but I also left the Macro I had been using as well. When it's run, I can't run it again. At the very least, I would like to have it so that I can re-run the macro when data is refreshed.

    In the file called "Pivot Table sample", I took the same file and ran the "show report filter pages" function to demonstrate what I'm trying to accomplish.

    Thank you for bearing with me as I explain myself as I'm sure I'm leaving something out. I do appreciate your feedback.

    Edit: I did not link the pivot tables together with the slicer as I had mentioned in the Pivot Table Sample file.
    Attached Files Attached Files
    Last edited by Ndekk; 09-26-2017 at 04:57 PM.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Splitting data based on column value

    I think this may be what you want. I kept your data: you can import / copy / paste or whatever to get data in there.

    I kept your Master Pivot Table. I created a pivot table with just the supplier name in the Suppliers Tab. This is the unique list of suppliers in the database.

    I created a slicer for the master pivot table.

    I did a one-time remove of all the supplier tabs and ran the program. The program looks at the supplier list and if the sheet does not exist, it copies the master pivot table sheet to the end of the workbook, changes the name to the supplier name, puts the supplier name in cell B1 (the filter) and then creates a slicer on that page. ALL the slicers are linked together. Change one and all of them change.
    Attached Files Attached Files

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Splitting data based on column value

    P.S. From here on out, you can keep the existing supplier pages. If a new supplier shows up, only that supplier will be added to the workbook.

  6. #6
    Registered User
    Join Date
    09-26-2017
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    3

    Re: Splitting data based on column value

    This is incredible! Thank you for all the work you've put into it!

+ 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. Splitting raw data into two new worksheets based on single column
    By Ezzard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2016, 08:21 PM
  2. Splitting out Excel data to multiple files based on one column's values
    By MetroBOS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-04-2015, 11:38 AM
  3. [SOLVED] splitting data into multiple tabs based on column criteria
    By bardobhb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-02-2014, 02:30 PM
  4. [SOLVED] splitting data into multiple tabs based on column criteria
    By bardobhb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2014, 11:57 PM
  5. [SOLVED] Splitting up data into separate sheets based on a column
    By cloakedgerb in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-23-2014, 12:37 PM
  6. Splitting data into seperate spreadsheets based on column values
    By narendrabr in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-03-2014, 07:16 AM
  7. [SOLVED] Splitting worksheets based on a column Data
    By Deventus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-17-2012, 06:40 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