+ Reply to Thread
Results 1 to 5 of 5

convert excel column data to comma seperated string

  1. #1
    Registered User
    Join Date
    02-17-2010
    Location
    Pakistan
    MS-Off Ver
    Excel 2003
    Posts
    5

    convert excel column data to comma seperated string

    I have excel file in which data is present in a column as


    234
    654
    222
    444
    667
    555


    I want this text in this form 234,654,222,444,667,555.I tried many ways bt unable to do so,Kindly tell me any easy way of doing this.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: convert excel column data to comma seperated string

    Formula wise it's a little convoluted unless you make use of 3rd party utilities like morefunc.xll and / or other custom UDFs of which there are plenty if you Google.

    A basic example of such a UDF being:

    Please Login or Register  to view this content.
    With the above stored in a Module in VBE you can utilise from native XL by virtue of a "normal" function in which you simply specify the range containing the values to be concatenated and preferred delimiter, eg:

    Please Login or Register  to view this content.
    would concatenate all non-blanks in the range, each value being delimited by a comma.
    Last edited by DonkeyOte; 04-28-2010 at 03:17 AM. Reason: missed the .Parent (important)

  3. #3
    Registered User
    Join Date
    05-21-2008
    MS-Off Ver
    2003/2007/2010
    Posts
    21

    Re: convert excel column data to comma seperated string

    Hi,

    Another approach would be:

    Please Login or Register  to view this content.
    Orlando Mezquita
    Last edited by orlandom; 04-28-2010 at 03:14 AM. Reason: Eliminate spaces from code
    Please read the Forum Rules:

    If your problem is solved, mark your thread as Solved. Read Forum's rule #10 to know how to do it.

    If you are happy with my answer please add it to my reputation by clicking in the icon next to the post number in my post.

    "Practice isn't the thing you do once you're good. It's the thing you do that makes you good."
    Malcolm Gladwell

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: convert excel column data to comma seperated string

    I should elaborate perhaps in response to above variant the reasons for the apparent complexity of the first code.

    The first code is designed to limit the need for iteration as much as possible and/or dispense with it fully where possible.

    The code will iterate only where range is a matrix (as opposed to a vector) and then only on a column by column basis - ie cell by cell iteration is avoided.

  5. #5
    Registered User
    Join Date
    04-27-2010
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: convert excel column data to comma seperated string

    Quote Originally Posted by faraz View Post
    I have excel file in which data is present in a column as


    234
    654
    222
    444
    667
    555


    I want this text in this form 234,654,222,444,667,555.I tried many ways bt unable to do so,Kindly tell me any easy way of doing this.
    Hi

    i have attached the sheet kindly refer,

    in that i have given 2 option
    1 is output in the same cell
    2 is to do the transpose
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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