+ Reply to Thread
Results 1 to 6 of 6

Splitting table by category into groups of specific size.

  1. #1
    Registered User
    Join Date
    01-21-2022
    Location
    bristol
    MS-Off Ver
    2013
    Posts
    3

    Splitting table by category into groups of specific size.

    Hello all, I'm new to VBA and I'm struggling with solving a problem. I have spent days searching for a solution and now I'm stuck!!!
    Any help would be greatly appreciated.

    Table 1 is filled and can be any length. There is a finite number of test types. Each test type can have any number of samples (ID). I want to create a new table (Table 2) that splits test type into groups of three for all test types and leaves blank any slots within a group of specific test type that aren't filled.

    Please see attached file.

    Many Thanks!!
    Attached Files Attached Files
    Last edited by charles1234; 01-31-2022 at 06:10 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Splitting table by category into groups of specific size.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new here, I will do it for yu this time: https://www.mrexcel.com/board/thread...-size.1194456/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-21-2022
    Location
    bristol
    MS-Off Ver
    2013
    Posts
    3

    Re: Splitting table by category into groups of specific size.

    Hi Ali,

    I didn't read the rules, But have now.

    Thanks for adding the link for me,

    Charlie.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,245

    Re: Splitting table by category into groups of specific size.

    Please Login or Register  to view this content.
    see sheet "TEST"
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    01-21-2022
    Location
    bristol
    MS-Off Ver
    2013
    Posts
    3

    Re: Splitting table by category into groups of specific size.

    Hi John.

    Thanks so much for the solution its great!!

    Just had to change one number in the code but essentially PERFECT!!!

    r = 1 ' row of input data

    to

    r = 2 ' row of input data

    as it output ID as an actual ID which threw off the ID alignment with tests (eg. table 3 and 4)

    Table3 Table 4
    1 ID 1 1 a 1
    1 a 1 1 b 1
    1 b 1 1 c 1
    2 c 1 2 d 1
    2 d 1 2 e 1
    2 e 1 2 f 1
    3 f 1 3 g 1
    3 Blank Blank 3 Blank Blank
    3 Blank Blank 3 Blank Blank
    4 g 2 4 h 2
    4 h 2 4 i 2
    4 Blank Blank 4 Blank Blank
    5 i 3 5 j 3
    5 j 3 5 k 3
    5 k 3 5 l 3
    6 l 4 6 m 4
    6 Blank Blank 6 Blank Blank
    6 Blank Blank 6 Blank Blank

    Thanks again for spending the time to help me this has made my day!!

    Charlie

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,245

    Re: Splitting table by category into groups of specific size.

    You are very welcome.

    Thank you for the feedback and rep.

+ 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. classify each one of the 3 groups number of times in each category
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2018, 07:49 AM
  2. [SOLVED] splitting formula giving wrong answer in a particular for specific pack size description
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-28-2018, 01:40 PM
  3. [SOLVED] Splitting frequency data by a category
    By mparker123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2014, 11:58 AM
  4. Filtering by text
    By saltarazan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-16-2013, 04:18 AM
  5. [SOLVED] Productsum: Highest Frequency Category, Specific Main Category, Frequency of Category
    By T86157 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-24-2012, 12:43 PM
  6. Splitting a list into groups
    By tay4432 in forum Excel General
    Replies: 2
    Last Post: 07-12-2008, 04:54 PM
  7. Splitting Data into Groups
    By oliver79 in forum Excel General
    Replies: 1
    Last Post: 01-15-2008, 07:05 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