+ Reply to Thread
Results 1 to 17 of 17

Vba code to split data with delimited "," in separate rows

  1. #1
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Vba code to split data with delimited "," in separate rows

    Need help to get the data from 3 separate columns with delimited comma in separate rows (new sheet)
    sample attached also shown below

    2017-04-25_143936.jpg
    Attached Files Attached Files

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Vba code to split data with delimited "," in separate rows

    Hi,

    In your example you could use the following code to split the cell B3 into a range starting at C7

    Please Login or Register  to view this content.
    Popluating the adjacent cells should be straightforward from there.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    It is not as per my requirement.
    Data should generate in new sheet with all 3 columns (not only one column)

  4. #4
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    also it should not be only for one cell, it should be multiple cells in entire column

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

    Re: Vba code to split data with delimited "," in separate rows

    Assumed Column (A) Column (BW) Column (CG) are column reference.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    YES, THOSE ARE COLUMN REFERENCES. BUT YOUR CODE IS NOT WORKING.
    NEW SHEET IS CREATED ONLY WITH

    CURRENT DATA
    Column (A)
    MM

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

    Re: Vba code to split data with delimited "," in separate rows

    Are you trying to express your feeling with ALL CPS?
    Then good luck.

  8. #8
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    No No.... Actually when we type in all CAPS, forum automatically turns it into =Proper() case. But I don't know why it didn't happen this time. Please don't take it otherwise.

    How would I express to the expert from whom I am expecting Help?

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

    Re: Vba code to split data with delimited "," in separate rows

    See the attached
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    Fantastic.... this is what i was looking for.

    but the actual data is not available only in single row.... hence request you instead of using only one cell use entire column. because the data is available in entire columns (multiple rows)

    also it might contain BLANK rows which should be ignored.

    you really reached very close to my actual requirement - THANKS

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

    Re: Vba code to split data with delimited "," in separate rows

    The you have to upload a workbook with Correct sheet layouts and EXACT results that you want.
    Otherwise it will be just wasting time for both.

  12. #12
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    Attached is sample of exact format (not required columns hidden)
    Attached Files Attached Files

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

    Re: Vba code to split data with delimited "," in separate rows

    Change to
    Please Login or Register  to view this content.

  14. #14
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    THANKS - IT WORKED

    One Additional Request - Just now I thought about one more possibility i.e. what if other columns will also contains multiple data separated with "," comma. Can you help with that also.

    This is just addition (leave it if not a valid request)

    sample file attached with REQUIREMENT sheet

    Also can we able to remove the blank rows?

    consider this as last request

    Thanks
    MG
    Attached Files Attached Files

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

    Re: Vba code to split data with delimited "," in separate rows

    Quote Originally Posted by [email protected] View Post
    consider this as last request
    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: Vba code to split data with delimited "," in separate rows

    THANKS A LOT FRIEND & yes will not disturb you more your help is really appreciated.

    BUT don't know why I got "Run Time Error for Type Mismatch" in a = Application.Index(.Value, Evaluate("row(1:" & .Rows.Count & ")"), [{85,1,75}])

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

    Re: Vba code to split data with delimited "," in separate rows

    Most probably you have more than 255 characters in any one cell.
    Try change to
    Please Login or Register  to view this content.

+ 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] Code that copies row of data to another sheet based on text "Complete"/"Delete"
    By Dremzy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-20-2014, 05:51 PM
  2. Replies: 2
    Last Post: 04-20-2014, 11:18 AM
  3. Replies: 0
    Last Post: 11-22-2013, 01:36 PM
  4. VBA Code- Move/Split cell content based on ","
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-19-2012, 11:37 AM
  5. [SOLVED] UDF to remove "equivalent" expressions from a ";" delimited string
    By dredwolf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2012, 07:25 PM
  6. [SOLVED] transpose the code from "rows" to "columns"
    By markx in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-21-2005, 05:05 AM
  7. [SOLVED] How do I split "A1B2" into "A1" and "B2" using text to column fun.
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2005, 06:06 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