+ Reply to Thread
Results 1 to 5 of 5

Copy to clipboard cell left to button

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    24

    Copy to clipboard cell left to button

    Bonjour,
    I want to create a button that will copy to windows clipboard the content of the cell left to it.

    Example
    In cell B1 I have text : "Hello World"
    In cell B2 I have a macro button named "Copy"

    When I hit the button, the text contained in the left cell is being copied to the clipboard.

    Now, I can do that easily with the following code :
    Please Login or Register  to view this content.
    What I'd like is somethig relative to where the button is located. If I create the macro button in cell W4, I want the content of the cell W3 sent to the clipboard. I just can't manage to select the right cell along with the SetTect function.

    Thansk for your help.

    Regards,
    William

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Copy to clipboard cell left to button

    Hi,

    Something like this
    Please Login or Register  to view this content.
    This does require that the top left corner of the button be within the correct cell.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    12-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy to clipboard cell left to button

    Bonjour xhitwit,
    at first I thought your code didn't work but it was because, well, it didn't work ... but this was before I figured out the "offset" part. The left cell is Offset(0, -1) ;o)

    Now your code works perfectly, exactly what I needed.

    Thanks

    Please Login or Register  to view this content.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Copy to clipboard cell left to button

    Ah yes- confused by the "right cell"! Also you did refer to w4 and w3 which is the cell above rather than to the left.

  5. #5
    Registered User
    Join Date
    12-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy to clipboard cell left to button

    Quote Originally Posted by xlnitwit View Post
    Ah yes- confused by the "right cell"! Also you did refer to w4 and w3 which is the cell above rather than to the left.
    Lol ... touché!

+ 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. Copy cell value to clipboard
    By adj7388 in forum Excel General
    Replies: 8
    Last Post: 03-25-2019, 11:45 AM
  2. [SOLVED] button to copy a range from selected row to clipboard
    By Cephei in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2016, 09:18 AM
  3. Paste values of a formula cell from a button to my clipboard?
    By tonyridino in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2015, 06:17 PM
  4. [SOLVED] Copy text to clipboard based on CheckBox value on Command Button click
    By askpcguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 01:21 AM
  5. macro to move 1 cell left and paste CURRENT clipboard content as HYPERLINK
    By sgoesef in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2013, 01:31 PM
  6. Copy one cell to an other but colors do not copy. While not using clipboard to copy.
    By chuckchuckit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2010, 03:08 AM
  7. Copy to clipboard button on / paste special button.
    By jasonmcbride in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2008, 11:53 AM

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