Cannot Paste into Textbox

A

Al

I need a user to be able to copy the contents of a worksheet cell,
open a usrform and paste those contents into a textbox - I can't seem
to do it. The cell contents are copied OK (CTRL-C to the clipboard)
but when the textbox is selected and CTRL-V used, nothing happens. I
don't see any relevant properties for the textbox relating to this
functionality - can anyone help?

Thanks,
Al
 
J

Jim Rech

I don't have any problem doing this but sometimes the clipboard is cleared
by Excel unexpectedly. I copied a cell and then ran a macro that did a
UserForm1.Show. The cell contents were pasted when I did a Ctrl-v (along
with unfortunately a carriage return character). So as long as the
clipboard isn't cleared by some action then the paste should work. (The
clipboard is not cleared as long as you see the "marching ants" around the
cell copied.)
 
T

Tom Ogilvy

select the cell, go to the formula bar, highlight the data, do ctrl+c

select the textbox by clicking in the textbox, do Ctrl+v

this always works for me.
 
R

Rabbit

From your description, this may be more what you're after. I could be
wrong, after all this is my first time posting to a newsgroup. Here
goes (you'll obviously have to change the Userform & Textbox names, if
they are other than "Userform1" & "Textbox1":

Sub FormShow()
Dim CHOSENCELL As String
CHOSENCELL = ActiveCell.Value
UserForm1.TextBox1.Value = CHOSENCELL
UserForm1.Show
End Sub


Or if you're pasting from another applicaton. There's a command called
"GetFromClipboard" which you could look up in the Excel help files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top