+ Reply to Thread
Results 1 to 10 of 10

Conditional Split File Based on Row and Column header Values

  1. #1
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Conditional Split File Based on Row and Column header Values

    Hi I Would like to split a source Excel file containing a list of shipment of products to multiple destination per week, so that it can be split into individual excel files based on the destination per week. Screenshot 2022-08-09 092733.png
    The output of the above single source file would be 5 separate files:
    1. Shipment List to London for Week 1
    2. Shipment List to London for Week 2
    3. Shipment List to New York for Week 1
    4. Shipment List to New York for Week 2
    5. Shipment List to Bangkok for Week 2
    Screenshot 2022-08-09 093232.png

    Would like to know if it is possible to do in Macro and if yes, how the code will be.

    Attaching the file as well for your reference. Sample Split File.xlsx
    Please do note that this is a dummy sample file, and the real use will be on a bigger data source. But the functions needed are already represented in the file.
    Looking forward to the support. Thank you!
    Attached Images Attached Images

  2. #2
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Conditional Split File Based on Row and Column header Values

    Upvoting this Thread, Thanks!

  3. #3
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Conditional Split File Based on Row and Column header Values

    Quote Originally Posted by patrickrw99 View Post
    ... and the real use will be on a bigger data source.
    That is to say: More rows or more columns?...

  4. #4
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12
    Quote Originally Posted by beyond Excel View Post
    That is to say: More rows or more columns?...
    Yes but its scalable I believe (e.g. more weeks (columns) or more peoducts (rows)

  5. #5
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Conditional Split File Based on Row and Column header Values

    Quote Originally Posted by patrickrw99 View Post
    Yes but its scalable I believe (e.g. more weeks (columns) or more peoducts (rows)
    Are you absolutely sure that the first four columns will ALWAYS be the same?

    And what will be the name of the workbooks to generate?
    Last edited by beyond Excel; 08-11-2022 at 11:08 AM.

  6. #6
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Conditional Split File Based on Row and Column header Values

    Quote Originally Posted by beyond Excel View Post
    Are you absolutely sure that the first four columns will ALWAYS be the same?

    And what will be the name of the workbooks to generate?
    Hi, Sorry for the late reply. yes the first four columns will be the same, the workbook name will be 'Shipment List_Destination_Week#'. Thank you!

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Conditional Split File Based on Row and Column header Values

    Based on your pics.

    Assuming the name of the source data sheet is "Sheet1" and the header starts from A1.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Conditional Split File Based on Row and Column header Values

    Quote Originally Posted by jindon View Post
    Based on your pics.

    Assuming the name of the source data sheet is "Sheet1" and the header starts from A1.
    Please Login or Register  to view this content.
    Wow thanks! I will try the code and update to you what I got. Thank you!

  9. #9
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Conditional Split File Based on Row and Column header Values

    Hi. Another way to do it:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-01-2022
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Conditional Split File Based on Row and Column header Values

    Quote Originally Posted by beyond Excel View Post
    Hi. Another way to do it:

    Please Login or Register  to view this content.
    Hi, Thank you for the solution, will try this as well.

    The Solution from @jindon works great Thank you for all the help

+ 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. Split master file by column values/ rename PQ output file?
    By njs27 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2019, 11:37 PM
  2. Split one Excel file into multiple files based on values in column A?
    By MetroBOS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2015, 10:59 AM
  3. Help With Conditional Averaging Based On Column Header...
    By jeffgreg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-15-2014, 08:56 PM
  4. Changing column values based on header values
    By CXsjr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-24-2013, 12:11 PM
  5. Replies: 0
    Last Post: 09-28-2012, 07:55 AM
  6. [SOLVED] How To Split Excel File Into Separate Workbooks Based on Values In a Specific Column
    By UzieJacuzzi in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 07-31-2012, 07:26 AM
  7. Two sums of column based on conditional split
    By Lope in forum Excel General
    Replies: 3
    Last Post: 04-08-2008, 09:41 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