+ Reply to Thread
Results 1 to 7 of 7

Separating multiple data (w delimiter) from one cell to many cells

Hybrid View

rocketeer425 Separating multiple data (w... 02-11-2014, 12:13 AM
:) Sixthsense :) Re: Separating multiple data... 02-11-2014, 01:10 AM
rocketeer425 Re: Separating multiple data... 02-11-2014, 04:51 AM
:) Sixthsense :) Re: Separating multiple data... 02-11-2014, 06:16 AM
rocketeer425 Re: Separating multiple data... 02-12-2014, 03:41 AM
:) Sixthsense :) Re: Separating multiple data... 02-12-2014, 03:47 AM
rocketeer425 Re: Separating multiple data... 02-14-2014, 03:56 AM
  1. #1
    Registered User
    Join Date
    02-04-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Separating multiple data (w delimiter) from one cell to many cells

    Hi Everyone,

    I am new in this website and I find this awesome with lots of cool information about excel!

    I would like to ask your help.

    Suppose we have a data like these:

    Name Account # Region Country
    Person A "10001,10002,10003,10004" North America USA
    Person B "10005,10006" Asia China
    Person C "10007,10008,10009" Europe Germany

    And assuming that we have tons of records like these. I would like to separate each "Account #" per row and retain all the rest of the columns. Is there a faster way for me to change it like the one below without doing it manually per row?


    Name Account # Region Country
    Person A 10001 North America USA
    Person A 10002 North America USA
    Person A 10003 North America USA
    Person A 10004 North America USA
    Person B 10005 Asia China
    Person B 10006 Asia China
    Person C 10007 Europe Germany
    Person C 10008 Europe Germany
    Person C 10009 Europe Germany

    Thank you

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Separating multiple data (w delimiter) from one cell to many cells

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    02-04-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Separating multiple data (w delimiter) from one cell to many cells

    Hi Sixthsense,

    Please see the sample workbook attached in this post.

    Additional information you may need:
    • I need the "Account #" column to be entered separately per row. Each account # for each row.
    • All other columns for a specific account # should also be included.
    • The comma (,) delimiter should be removed and the quote-sign (" ")

    Thank you
    Attached Files Attached Files

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Separating multiple data (w delimiter) from one cell to many cells

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button

    Sub SplitAndReplicateData()
    Dim rMyRng As Range, r As Range, rNxt As Range, i As Integer, vSplit As Variant
    
    Set rMyRng = Application.InputBox("Select Data Range", "Range Req.", _
                    Range("A1").CurrentRegion.Address, , , , , 8)
    
    Sheets.Add
    Set rNxt = ActiveCell
    
    Application.ScreenUpdating = False
    
    For Each r In rMyRng.Rows
        vSplit = Split(Replace(r.Cells(2).Value, """", ""), ",")
        For i = 0 To UBound(vSplit)
            r.Copy rNxt
            rNxt.Offset(, 1).Value = vSplit(i)
            Set rNxt = rNxt.Offset(1)
        Next i
    Next r
    
    Range("A1").CurrentRegion.Columns.AutoFit
    
    Application.ScreenUpdating = True
    
    End Sub

  5. #5
    Registered User
    Join Date
    02-04-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Separating multiple data (w delimiter) from one cell to many cells

    Sixthsense, it works like magic! Thank you so much for the help!

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Separating multiple data (w delimiter) from one cell to many cells

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    02-04-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Separating multiple data (w delimiter) from one cell to many cells

    Done! And thank you again for your help Sixthsense

+ 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. Replies: 8
    Last Post: 03-18-2013, 11:14 PM
  2. [SOLVED] Multiple text values in 1 cell separating into two cells in number format
    By Mengo85 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-08-2013, 10:50 AM
  3. Separating Data of 1 cell into multiple columns
    By jamesb01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-15-2009, 09:38 AM
  4. Separating cell data into 2 new cells.
    By Joe@WSC in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 07-07-2009, 10:10 AM
  5. Separating Name and Address with No Delimiter
    By lizzae in forum Excel General
    Replies: 4
    Last Post: 04-22-2009, 03:49 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