+ Reply to Thread
Results 1 to 5 of 5

Convert range of cells to comma separated list

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Bentley, NM
    MS-Off Ver
    Excel 2010
    Posts
    229

    Convert range of cells to comma separated list

    I need to take the range of cells from C2:C50 and extract each cell's contents and convert them into a list of values separated by commas. The new list can be copied to the clipboard or inserted into a new cell.

    For example: C1 = 50, C2 = 23 ---------convert to "50,23"

    I'm doing this, because I need to use these values as query criteria in Access 07. Usually I will just paste the values into a new table and join on the field(s) needed for criteria, but in this case I think the best way to run this query is to "hardcode" the values into the actual SQL statement.
    Last edited by maw230; 01-23-2012 at 05:57 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,272

    Re: Convert range of cells to comma separated list

    Please Login or Register  to view this content.

    Regards, TMS
    Last edited by TMS; 01-23-2012 at 05:46 PM. Reason: Amend Function
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Convert range of cells to comma separated list

    maw230,

    In Excel VBA you could do somehting like this:

    Please Login or Register  to view this content.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Bentley, NM
    MS-Off Ver
    Excel 2010
    Posts
    229

    Re: Convert range of cells to comma separated list

    Quote Originally Posted by TMShucks View Post
    Please Login or Register  to view this content.

    Regards, TMS
    Works like a charm! Thanks!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    36,272

    Re: Convert range of cells to comma separated list

    You're welcome. Thanks for the rep.

+ 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