+ Reply to Thread
Results 1 to 9 of 9

How to copy value of selected cell to windows clipboard?

  1. #1
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Arrow How to copy value of selected cell to windows clipboard?

    Please Login or Register  to view this content.
    I have the code above. I need to copy active cell value for my other uses. Someone said the answer above in bold but then I got error. Could you give me a hint please?

    Selection.Copy
    Application.CutCopyMode = False

    doesn't work.

    Selection.Copy

    works but I don't want this cell remain as selected.
    Last edited by 1tane1; 05-21-2013 at 06:34 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: How to copy value of selected cell to windows clipboard?

    Please Login or Register  to view this content.
    if problems explain better your goal
    Last edited by patel45; 05-21-2013 at 04:05 AM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to copy value of selected cell to windows clipboard?

    if you use the early bound dataobject you must set a reference to the microsoft forms 2 object library
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  4. #4
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: How to copy value of selected cell to windows clipboard?

    Application.CutCopyMode = False

    doesn't work. Clipboard becomes empty.

    Could you elaborate more on object library? Because I'm vba illiterate. I just combine vba parts from internet for my own use, but I don't type them, if they are really complicated.

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: How to copy value of selected cell to windows clipboard?

    in the vb editor select tools-references on the menu and then find and check the "Microsoft Forms 2.0 Object Library"

  6. #6
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: How to copy value of selected cell to windows clipboard?

    As JosephP said, you need to set up reference to Microsoft Forms 2.0 Object Library in order to make your original code to work.
    To do this, in VBE go to Tools->References find Microsoft Forms 2.0 Object Library and tick the checkbox
    If you are pleased with a member's answer then use the Star icon to rate it.

  7. #7
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: How to copy value of selected cell to windows clipboard?

    I added Microsoft Forms 2.0 Object Library. Then I got an error. Debugger highlighted SetText, saying:
    Compile error:
    Sub or Function not defined

    so, now how to define SetText?

  8. #8
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: How to copy value of selected cell to windows clipboard?

    Please Login or Register  to view this content.
    Note the dots in front of SetText and PutInClipboard

  9. #9
    Forum Contributor
    Join Date
    01-08-2013
    Location
    ankara
    MS-Off Ver
    Excel 2010
    Posts
    134

    Re: How to copy value of selected cell to windows clipboard?

    Quote Originally Posted by buran View Post
    Please Login or Register  to view this content.
    Note the dots in front of SetText and PutInClipboard
    That worked perfectly. Thank you very much.

    I became happy when my codes work :D

+ 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