+ Reply to Thread
Results 1 to 4 of 4

Replicate a row for each comma separated value in a cell

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    50

    Replicate a row for each comma separated value in a cell

    Hi all,

    I'm very new to VBA and would hugely appreciate any help to figure out this issue. Attached is an example of my data, in which I would like to create a VBA script that looks at column D, and replicates that row for each comma separated piece of text in that cell.

    For example, since Row 2, column D displays "707, All Users", I would like this row to appear twice with the unique comma separated text in each row. Hope that makes sense!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Replicate a row for each comma separated value in a cell

    Sorry dont have time at the mo, but use SPLIT(text,separator) so split(range("d1").value,",") This will pass the broken up details to an array, then you can use UBOUND to find out how many rows to add.

    this will split it then look at row inserting on google.

    I am off home now, so cant offer any more advise, should be a good place to start
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

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

    Re: Replicate a row for each comma separated value in a cell

    This should do...
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-16-2013
    Location
    Boston, Massachusetts
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Replicate a row for each comma separated value in a cell

    Thank you both, and this is exactly the solution I was looking for Jindon! Much appreciated.

+ 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. Counting numbers within a cell separated by comma
    By hactic in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-15-2011, 09:37 PM
  2. Excel 2007 : Selected columns to comma separated cell
    By mossman in forum Excel General
    Replies: 4
    Last Post: 12-20-2009, 10:42 AM
  3. calculate comma separated value in a cell
    By rsdharan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2009, 02:21 PM
  4. Resolved >>> Comma separated values in a cell
    By usr789 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-25-2007, 08:36 AM
  5. combine rows into one cell separated by comma
    By Miki Jo in forum Excel General
    Replies: 2
    Last Post: 03-09-2006, 04: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