+ Reply to Thread
Results 1 to 6 of 6

Split data into multiple columns and rows based on specific string

  1. #1
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Split data into multiple columns and rows based on specific string

    Hello

    It's been a while from the last visit to this great forum and touch vba things.

    I have a file contain 2 columns, ID and data ( a b c d )
    the goal is to split the data into multiple column ( ID, a, b, c, d )
    how ever the data in column B is sometime not ( a b c d), but repeat data ( a b c d a b c d a b c d)
    so they need to split into multiple column and multiple rows based on the ID.

    Attached is the example file, i hope i get a hint about the correct vba code.

    Thank you all.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split data into multiple columns and rows based on specific string

    Try next code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by PCI; 11-26-2018 at 05:19 AM.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Re: Split data into multiple columns and rows based on specific string

    Sorry for late respond, just logged back in.

    I have checked the code, it works perfectly, many thanks!
    Trying to play around.
    What if i want to add more data: example: a,b,c,d,e,f instead of a,b,c,d

    Thank you.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split data into multiple columns and rows based on specific string

    What if i want to add more data: example: a,b,c,d,e,f instead of a,b,c,d
    If the frame is exactly the same ( as it is in your example) you just need to complete the list of items
    Use next code
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Re: Split data into multiple columns and rows based on specific string

    Thank you!

    anyway, is the code only work single word data ( non space ) , i tried to change the data into sentence, somehow not work
    example:

    a:this is text b:3 c:this is text2 d:text3 text4

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Split data into multiple columns and rows based on specific string

    Did you put a comma between words
    Attach a new Excel sample

+ 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 Single Row into multiple rows based on column data
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2017, 01:57 PM
  2. Split Column into Multiple Columns Based Off Specific Criteria
    By hellzone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2017, 09:49 PM
  3. [SOLVED] Excel - Compare data based upon specific criteria split into columns and delimiters
    By Funkadlic01 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-01-2017, 09:36 PM
  4. split string into multiple columns
    By bmccall17 in forum Excel General
    Replies: 8
    Last Post: 06-05-2015, 12:27 AM
  5. Split Row Into Multiple Rows based on Count of Data
    By bchilme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2014, 05:58 PM
  6. Split data into multiple documents based on specific column
    By v_nastey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 08:56 AM
  7. Row split in to multiple rows based on cell data
    By bosuck in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2011, 05:30 PM

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