+ Reply to Thread
Results 1 to 7 of 7

Convert Column Into Comma-Separated List: Getting Around Character Limit

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    USA
    MS-Off Ver
    2019 16.0.13205.200000 64-bit
    Posts
    61

    Convert Column Into Comma-Separated List: Getting Around Character Limit

    Hey, guys!

    I'm struggling with a little challenge. I have a list of entries in Column A, in each cell there are 2-3 words, around 17 000 rows in whole column, and 160 000 characters in whole column. I need to take each cell in Column A and put them into a comma-separated list.

    So if Column A looks like this:
    Cow
    Apple
    Cider
    Banana

    I need a macro that would make it into: Cow, Apple, Cider, Banana

    I found the following macro online:
    Please Login or Register  to view this content.
    It stores resulting list in a cell (B1). The problem is that since I have more than 160 000 characters in the column, it exceeds Excel's cell character limit of 32 767.
    Is there way to store result in clipboard maybe or some other workaround?
    Last edited by splendidus; 08-14-2020 at 10:41 AM.
    Office 2019 16.0.13205.200000 64-bit

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,976

    Re: Convert Column Into Comma-Separated List: Getting Around Character Limit

    What do you plan to use it for?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    USA
    MS-Off Ver
    2019 16.0.13205.200000 64-bit
    Posts
    61

    Re: Convert Column Into Comma-Separated List: Getting Around Character Limit

    Quote Originally Posted by rorya View Post
    What do you plan to use it for?
    It goes as an input (I'm pasting it there) for a web service.

    It used to work with a vertical column list, so I could just select whole Column A and copy/paste it. But now this service requires a comma-separated list, so I need a macro that would convert column into a comma-separated list. Storing in clipboard sounds like a viable option, since I'm pasting the resulting comma list somewhere else anyhow.
    Last edited by splendidus; 08-14-2020 at 06:47 AM.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,976

    Re: Convert Column Into Comma-Separated List: Getting Around Character Limit

    You could use a function like this to put the text in the clipboard:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-09-2012
    Location
    USA
    MS-Off Ver
    2019 16.0.13205.200000 64-bit
    Posts
    61

    Re: Convert Column Into Comma-Separated List: Getting Around Character Limit

    Quote Originally Posted by rorya View Post
    You could use a function like this to put the text in the clipboard:

    Please Login or Register  to view this content.
    Thank you for the input, rorya! Since I'm not very strong in VBA I don't know how to properly apply this to a the macro I quoted. Any chance you could be so kind to show how does it actually apply?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,976

    Re: Convert Column Into Comma-Separated List: Getting Around Character Limit

    Add that as a separate function, then replace this:

    Please Login or Register  to view this content.
    in your code with this:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-09-2012
    Location
    USA
    MS-Off Ver
    2019 16.0.13205.200000 64-bit
    Posts
    61

    Re: Convert Column Into Comma-Separated List: Getting Around Character Limit

    Quote Originally Posted by rorya View Post
    Add that as a separate function, then replace this:

    Please Login or Register  to view this content.
    in your code with this:

    Please Login or Register  to view this content.
    Thank you, rorya, much obliged!


    Purely for posterity. This is what I added into a Module in my file:
    Please Login or Register  to view this content.
    So far so good! :D

+ 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. How to lookup a value in one column to create a comma separated list
    By powersml07 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-05-2018, 02:16 PM
  2. Replies: 5
    Last Post: 06-29-2016, 01:27 PM
  3. Help Creating a comma separated list based on a specific column
    By zach.shupp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2014, 09:44 PM
  4. Replies: 3
    Last Post: 09-25-2014, 02:14 PM
  5. Programatically Convert comma separated 'Text to Column'
    By super_duper_guy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-01-2012, 08:04 PM
  6. Convert range of cells to comma separated list
    By maw230 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2012, 06:03 PM
  7. Going from column to comma separated list...
    By jmboggiano in forum Excel General
    Replies: 1
    Last Post: 03-10-2005, 01:06 PM

Tags for this Thread

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