+ Reply to Thread
Results 1 to 6 of 6

Data in Column A to Comma Delimited List

Hybrid View

  1. #1
    Registered User
    Join Date
    05-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    11

    Data in Column A to Comma Delimited List

    I have an excel spreadsheet that has data in column A like in the attached example spreadsheet. How can I make this into a comma delimited list? So something like this...

    food
    drinks
    home
    shelter
    ocean
    water


    to this ---> food, drinks, home, shelter, ocean, water
    Attached Files Attached Files
    Last edited by webdivx; 05-31-2012 at 01:23 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Data in Column A to Comma Delimited List

    How long is your data?

    If this is the entire list then this will work

    =CONCATENATE(A1,", ",A2,", ",A3,", ",A4,", ",A5,", ",A6)

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Data in Column A to Comma Delimited List

    Hi

    Try this code. Not sure about formula:

    Sub COMBINEDATA()
        Dim rcnt As Long, mergestr As String
        
        rcnt = Range("A" & Rows.Count).End(xlUp).Row
        mergestr = ""
        
        For i = 1 To rcnt
            If mergestr = "" Then
                mergestr = Range("A" & i).Value
            Else
                mergestr = mergestr & "," & Range("A" & i).Value
            End If
            Range("B1").Value = mergestr
        Next
    End Sub
    Click *, if my suggestion helps you. Have a good day!!

  4. #4
    Registered User
    Join Date
    05-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Data in Column A to Comma Delimited List

    Thank you jraj1106, this works perfectly and was exactly what I was looking for!!!

    My spreadsheet has over 10K rows so manually doing that function would be troublesome rvasquez, but I also thank you for taking the time to share your knowledge!

  5. #5
    Registered User
    Join Date
    07-11-2013
    Location
    Martinez, CA
    MS-Off Ver
    2010
    Posts
    1

    Re: Data in Column A to Comma Delimited List

    Hi folks. New to forum. I know, really old thread but I need to do exactly this. However, I don't understand where that macro gets written. Anyone able to give me some more clarification as to how to make this work?

    Thanks .......... Rob

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Data in Column A to Comma Delimited List

    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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