+ Reply to Thread
Results 1 to 8 of 8

Copy non-consecutive cells to clipboard

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Copy non-consecutive cells to clipboard

    Hi guys,

    I've been searching for an answer and this is the closest I've gotten. I need a macro that will get the data in the last row of a column, copy that and copy other non-consecutive cells to the clipboard for pasting in a different application.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Copy non-consecutive cells to clipboard

    What's your question? This doesn't work?
    Why not use a variant, put everything in there and just use split to paste?

  3. #3
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copy non-consecutive cells to clipboard

    Sorry I missed out that last bit in my post. The above doesnt work. I keep getting a 400 error

    Also the macro is called from a button on the sheet itself
    Last edited by ukyank; 05-24-2013 at 06:51 AM.

  4. #4
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copy non-consecutive cells to clipboard

    Darn thought this would be easier to search does nyone have any ideas where my code has gone wrong?

    TIA

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: Copy non-consecutive cells to clipboard

    Have O4 and N4:R8. This would copy O4 twice. Is that what you want or an oversight?

  6. #6
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Copy non-consecutive cells to clipboard

    Ugh dumb mistake, I fixed that one but I still get the 400 error. The sheet was protected but I took off the protect and it still wont copy the cells.

  7. #7
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Copy non-consecutive cells to clipboard

    "lngLast" evaluates to a rownumber, not a range.

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: Copy non-consecutive cells to clipboard

    Workaround code but I am looking forward to someone coming with a code to directly copy into clipboard. Still learning I am
    It assumes that Column H is empty. If Not, change the reference to an empty column.


    Please Login or Register  to view this content.

+ 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