+ Reply to Thread
Results 1 to 6 of 6

Automatically create new rows based on a delimited string in one cell?

  1. #1
    Registered User
    Join Date
    11-09-2009
    Location
    Shropshire UK
    MS-Off Ver
    Excel 365
    Posts
    38

    Question Automatically create new rows based on a delimited string in one cell?

    Hi.

    I have a large spreadsheet of product data where one column contains the variations of each product as a delimited string.

    I need a separate row for each of the variations so how do I automatically create additional rows under the original and then have the delimited string spread across those rows, like this: -

    Attachment 599340

    Thanks :-)

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: How do I automatically create new rows based on a delimited string in one cell?

    See if this works for you

    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Registered User
    Join Date
    11-09-2009
    Location
    Shropshire UK
    MS-Off Ver
    Excel 365
    Posts
    38

    Re: How do I automatically create new rows based on a delimited string in one cell?

    Thanks for your help JLGWhiz.

    I'm confident to add the VBA but I don't understand the code so I need a little help to modify it for my spreadsheet if you can help? The column with the delimited text is K and the product variations can be from 2 to 10 in quantity (not sure if this matters). The spreadsheet has column headers. Thanks ;-)

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: How do I automatically create new rows based on a delimited string in one cell?

    Quote Originally Posted by Thintin View Post
    Thanks for your help JLGWhiz.

    I'm confident to add the VBA but I don't understand the code so I need a little help to modify it for my spreadsheet if you can help? The column with the delimited text is K and the product variations can be from 2 to 10 in quantity (not sure if this matters). The spreadsheet has column headers. Thanks ;-)
    It really helps if you give an accurate layout of your data by columns and rows in the original post. See if this will work for you.

    Please Login or Register  to view this content.
    If you have data past column K, it will not fill down as columns A-J does. Copy the code to your standard code module1.

  5. #5
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Automatically create new rows based on a delimited string in one cell?

    Thanks for the reps. If Post #4 closed the issue, the you should mark the thread as solved.
    Regards, JLG

  6. #6
    Registered User
    Join Date
    11-09-2009
    Location
    Shropshire UK
    MS-Off Ver
    Excel 365
    Posts
    38

    Re: Automatically create new rows based on a delimited string in one cell?

    Happy new year!

    I put this part of my project on hold while I sorted out some more pressing issues but I'm back on it now.

    When I run this code I get a 'compile error: Variable not defined' at the first mention of 'c' (see screenshot)

    VBA compile error.jpg

+ 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] Reading a serial port delimited string into rows
    By land35 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2015, 08:46 AM
  2. Multiply and sum values across columns based on delimited string
    By Pen+Paper in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2014, 04:06 PM
  3. [SOLVED] Automatically create and fill rows based on a given quantity
    By Bax in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2013, 09:49 AM
  4. [SOLVED] Summing Values Based on a Comma Delimited String
    By bryan0 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-18-2013, 11:43 AM
  5. VBA Script to create new rows based on delimited data
    By aaronic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-10-2012, 06:20 PM
  6. Replies: 1
    Last Post: 11-18-2009, 08:12 AM
  7. Searching a comma delimited string in a cell
    By migpics in forum Excel General
    Replies: 7
    Last Post: 11-26-2007, 05:58 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