+ Reply to Thread
Results 1 to 18 of 18

Copy Cell Text Only Content on single Click

  1. #1
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Copy Cell Text Only Content on single Click

    Hi Guys,

    I'm new here and I in need of a macro script that will Copy Cell Text Only Content on single Click.

    Any help would be greatly appreciated, I've made a few attempts at this but couldn't figure it out. Would someone be able to make this for me?

    Thanks in advance!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Copy Cell Text Only Content on single Click

    It would be best to provide some examples of what is in these cells?

    How many cells? Where are the cells and where do you want things placed?

    Please post a sample workbook of before and after
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Red face Re: Copy Cell Text Only Content on single Click

    Hi Jeffery,

    Here's a sample code I was using but would like to modify it to copy text ONLY:

    Please Login or Register  to view this content.
    I need text only to be able to paste properly into a program I use at work.

    The way I've been able to do so far is by triple clicking the cell, highlighting the text and THEN copying and pasting into the other program - but I'm trying to simplify it down to just single click and paste.

    Any help would be greatly appreciated.
    Last edited by Leith Ross; 04-20-2012 at 02:00 PM. Reason: Changed Quote Tags to Code Tags

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Copy Cell Text Only Content on single Click

    Try this...

    I'm guessing you already have values in B2:G10. not sure how this helps you. Couldn't you just right click and copy then paste the text to the other program. Anyway, with this macro when you double click the cell it wii only copy if it is text.

    Please Login or Register  to view this content.
    If this does not do it then more explanation is required

  5. #5
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    Hi Jeff,

    Thanks for the code, but I think it's still only copying text and whatever else content existing in the cell I click because when I paste into the other program, it doesn't paste. I think it's pasting something other than text which is why I need the script to ONLY copy text-nothing else other wise pasting into the program won't work.

    As mentioned in my previous post, the strange thing is that if I triple click the cell, highlight the text, copy, switch to other program and paste- it'll work. So that's why I'm concluding that it can only accept text. I've also tried copying and pasting text from note pad which also works. The reason I need this script is because there is a ton of data I need to transfer into the other program so I'm trying to cut down on the number of clicks, highlighting, copy & pasting process to just a click and paste.

    If you have any more ideas-that would be great, Thanks again!

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Copy Cell Text Only Content on single Click

    Well I can't say I have any real ideas since I don't know what I am working with here.

    Can I see a sample workbook of the text you are trying to copy and into what type of program are you pasting the results?

  7. #7
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    Hi Jeff,

    Here's a sample of the data:

    Please Login or Register  to view this content.
    Each word is in a seperate cell and I have to triple click the cell, highlight the text, copy, switch to other program and paste.

    What I'd like to do is be able to click once and paste text only into the other program. (Again, It must be text only other wise it won't paste for whatever reason)

    The program I'm using is called Orion by VCI solutions, it's a broadcast traffic program.

    There was another guy who was trying to help me in different forum but I couldn't figure out how to get the code he provided working - see here:

    http://www.mrexcel.com/forum/showthr...1&goto=newpost

    I'm glad to be able to get a second opinion on this.

    I really appreciate your help and persistence - Thanks again!
    Last edited by Leith Ross; 04-20-2012 at 02:01 PM. Reason: Changed Quote Tags to Code Tags

  8. #8
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Copy Cell Text Only Content on single Click

    Using
    Please Login or Register  to view this content.
    should put the content of the activecell in the clipboard every time you select a new cell.
    Good luck.

  9. #9
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    Hi OnErrorGoto0,

    Thanks for your reply.

    I know for sure I must be doing something wrong because the code does not seem to run when I paste it into the code window.

    Here's what I'm doing:

    1. Open excel spread sheet with data I need to copy

    2. Open VBA window

    3. In VBA Insert UserForm1 so Microsoft Forms 2.0 Object Library is available and selected from the References list.

    4. In VBA Double click Sheet1

    5. In VBA Paste Code into Sheet1

    At this point I switch back to the excel spread sheet data to test by clicking on a cell within the specified range in code "A1:J281" but nothing happens. I don't get it, can you please give me a step by step instructions on how to get this working or point out what I'm doing wrong?

    I'm using windows 7 sp1 and ms excel 2003 sp3

    Thanks again - I appreciate everyone's patience & help with this.
    Last edited by Rabbitstew; 01-27-2012 at 02:19 PM.

  10. #10
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    I double posted... sorry
    Last edited by Rabbitstew; 01-27-2012 at 02:19 PM.

  11. #11
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Copy Cell Text Only Content on single Click

    That code needs to go into the ThisWorkbook module - it is designed to work with all sheets. Also, you can just set a reference rather than adding an unnecessary userform. (it could also be late bound so you wouldn't need any references)

  12. #12
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    0EGO,

    Thanks again for your response.

    I tried pasting the code into the workbook without inserting UserForm1 but got Compile Error: "User-defined type not defined" and "DataObj As MSforms.DataObject" line was highlighted in the module.

    I tried again but having inserted UserForm1 in order to get reference to Microsoft Forms 2.0 Object Library (It appears I need to do this otherwise Microsoft Forms 2.0 Object Library will not be available in the references list). It got rid of the Compile Error but nothing happens when I click a cell in the spread sheet with in the cell parameters specified in the code. From what I understand, the script should just work once the code is pasted in.

    I'm stumpted, any ideas?
    Last edited by Rabbitstew; 01-27-2012 at 04:22 PM.

  13. #13
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Copy Cell Text Only Content on single Click

    You can set the reference yourself via the Tools-References dialog without needing to insert a userform, but it's not really important.

    The code should work but all it does is copy the text to the clipboard. I assume you are then pasting it elsewhere to test? (pasting to another cell in the workbook obviously will not work)

  14. #14
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    0EGO,

    I tried your code at home on my macbook and it works! I'll have to try it again when I'm back at work. Will keep you posted.

    Thanks again so much!

  15. #15
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Copy Cell Text Only Content on single Click

    My pleasure. You can actually skip the referencing and use

    Please Login or Register  to view this content.
    if you prefer.

  16. #16
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    0EGO,

    You are THE MAN! The script works flawlessly, thanks so much! :D

  17. #17
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    Hi again guys,

    First of all thank you so much for the help and for the script that works flawlessly.

    After much use and for my work purposes, I'm realizing it would be more efficient to use arrow keys to select and copy text only rather than single clicking. So would it be possible to modify the script to copy text only using any arrow key? ie: what ever cell is selected after hitting any arrow key it lands on will have text only copied instead of the click?

    Thanks so much in advance any help would be greatly appreciated.
    Last edited by Rabbitstew; 04-20-2012 at 01:48 PM.

  18. #18
    Registered User
    Join Date
    01-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Copy Cell Text Only Content on single Click

    *bump* Anyone? please help!

+ 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