+ Reply to Thread
Results 1 to 8 of 8

Copy to clipboard

  1. #1
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Copy to clipboard

    Hi guys
    after a way to copy a group of cells to clipboard (a21 to c24)
    and leave it there until i need it
    is this possible?

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Copy to clipboard

    Good morning excellentexcel
    Quote Originally Posted by excellentexcel View Post
    after a way to copy a group of cells to clipboard (a21 to c24) and leave it there until i need it
    is this possible?
    The clipboard is a Windows object, not an Excel object so referencing it is not as easy as you might think.

    Chip Pearson has an excellent article on the issue here with code examples and workbooks for download.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Re: Copy to clipboard

    Thanks dominic
    not quite sure how i can adapt that though to suit my needs?i just want to press the button and it will store them cells on my clipboard.
    Tried doing it using macro recorder to no avail

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Copy to clipboard

    Hi excellentexcel
    Quote Originally Posted by excellentexcel View Post
    Thanks dominic
    not quite sure how i can adapt that though to suit my needs?i just want to press the button and it will store them cells on my clipboard.
    Tried doing it using macro recorder to no avail
    The macro recorder won't work as it's a Windows object.
    Have a look at the attached example. type something in A1, click the button and then manually paste it somewhere else.

    HTH

    DominicB
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Re: Copy to clipboard

    HI DOMINIC
    YORU WORKS GREAT BUT WHEN I CHANGE IT TO SUIT
    AS IN:-

    HTML Code: 
    I GET RUN TIME ERROR 13
    TYPE MISMATCH

    AND IT HIGHLIGHTS THE LINE
    HTML Code: 

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Copy to clipboard

    Hi excellentexcel

    OK. The clipboard can only hold one item at a time - it can be manipulated into copying multiples into there, but you are going to have to manually keep track of the size of the array (R x C) and the items in there, and (possibly) a delimiter character. Do you really have to use the clipboard?

    Take a look at the code below - it's a bit rough at the moment, but it's a starting point. Highlight a selection (say 10 rows x 3 columns) and run the copy1 macro.

    Now highlight a blank range (different shape - same number of cells, say 2 rows x 15 columns) and run the macro paste1.

    As I say, it needs refining, perhaps you would like it to keep tha shape of the selection, so you only need to select 1 cell and paste from there - but it's a starting point. Would this be of any use to you?

    Please Login or Register  to view this content.
    HTH

    DominicB

  7. #7
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Re: Copy to clipboard

    cheers for your efforts dominic
    i have to be honest to you and say i cant get my head round that
    perhaps it will be easier if i just do it as i have done for the last 6 months
    thanks all the same

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Copy to clipboard

    try a freware clipboard extender like this one
    http://www.clipmagic.com/
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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