I have a user form which has a field txtA . I would like to add a button next to this field which when pushed will copy the contents of txtA to the clipboard so that it can be pasted into anoth application.
Any help would be extremely helpful.
I have a user form which has a field txtA . I would like to add a button next to this field which when pushed will copy the contents of txtA to the clipboard so that it can be pasted into anoth application.
Any help would be extremely helpful.
Last edited by jcarstens; 09-25-2009 at 12:37 PM.
you will get better results if you upload the file.
if you insert a button insertI can get this to work, but i still have to highlight the text that has been entered into TextBox1 which seems to be counter productive. I don't know what the macro script would be to select the text entered into TextBox1 to copy it.![]()
Please Login or Register to view this content.
Place this code in your button, remember to make sure that the TextBox name is correct
![]()
Please Login or Register to view this content.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Thanks for the help. Its much appreciated!
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
I tried out the code and had it working for a second, but know I am experiencing errors. I put this in the attachment.
Hello jcarstens,
Please update your User Profile to reflect which version or versions of Excel you are using. I had no idea you were using 2007 until I downloaded your zip file.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
What errors are you experiencing. The form works fine.
I entered text into the textbox, clicked the button then opened Notepad & pasted. Worked fine.
Weird.Mine is working now too. Not sure what the problem was.
Thanks for the help.
I have had success with the following approach, which uses some properties and methods of text boxes directly.
I have wrapped the code in a subroutine. Use like this where "MyTextBox" is the actual name of the textbox containing the text to copy.
CopyTextFromTextbox MyTextBox
The closest Microsoft reference to SelStart, SelLength, SetFocus I can find is the following![]()
Please Login or Register to view this content.
http://msdn.microsoft.com/en-us/library/aa223162(v=office.11).aspx
Hope that helps.
Hello Don Toto,
Your suggestion is appreciated but In case you had not noticed, this thread is almost 2 years old.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks