+ Reply to Thread
Results 1 to 5 of 5

Paste Only Visible Cells, Comma Delimited

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Paste Only Visible Cells, Comma Delimited

    Hello,

    I am working on a file that lists a series of product codes, some of which are grouped together. I am trying to put together a macro that will allow you to select a range of codes within a column and have those codes pasted only the visible cells into a Word document, with each code separated by a comma. So far, I have been able to accomplish most of the task - I can have the selected cells sent over to word, comma-delimited, but I cannot get the macro to operate on visible cells only.

    I have attached a sample file with code.

    From the sample file, my desired result would be:
    "Green,Blue,Yellow,Orange,Red,Black,Brown"

    However, while making modifications, I have only been able to get:
    "Green,Blue,Yellow,Orange,Red,Red,Red,Red,Red,Black,Brown", and
    "Green,Blue,Yellow,Orange,Red"

    Please let me know if you have any suggestions.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: Paste Only Visible Cells, Comma Delimited

    BTW, the first undesireable string of colors came from using:
    Please Login or Register  to view this content.
    The second undesireable string of colors came from using:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Paste Only Visible Cells, Comma Delimited

    Hi Gator,

    Try it this way:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: Paste Only Visible Cells, Comma Delimited

    xladept - thanks for the code. It worked perfectly for the example I posted, and I was able to adapt it for my real data.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Paste Only Visible Cells, Comma Delimited

    You're welcome!

+ 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