Move data from userform to worksheet textbox

rszczypk

Board Regular
Joined
Sep 10, 2002
Messages
63
I'm still trying to figure out how to move data from a textbox in a userform to a textbox on the worksheet (created from picture toolbar). I manually recorded the following macro to see what code excel wanted. I've put this into my userform code and it runs without errors. Problem is, the textbox remains empty.


Private Sub CommandButton2_Click()
MsgBox ("Please load letterhead paper into the printer. Press OK when ready.")
ActiveSheet.Shapes("Text Box 239").Select
Selection.Characters.Text = TextBox10.Text
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Should I be looking for an alternative to this method? I'm trying this because the data exceeds excels cell display capabilities. If I dump the data into a cell (which works fine) not all of the characters are displayed. It was suggested that I try utilizing a textbox instead of a cell.

:cry:
 
Upvote 0
Hi Rich

I might be missing something but I've just tried the code you posted and it worked.
Can you just check that your text box on the form is indeed Textbox10 and that the one on the sheet is really Text Box 239.

Or is there any more info you can give us?

Ta
AJ
 
Upvote 0
thanks for the reply. Yes, I've verified all of the information is correct. When you tested it were you transferring from a userbox textbox to a worksheet item?

I can't figure out myself why the box stays empty.

Rich
 
Upvote 0
rszczypk, I tried your code as well using a userform textbox to transfer data to a worksheet textbox and it worked. You made mention of creating the textbox on your worksheet from the Picture toolbar.

a textbox on the worksheet (created from picture toolbar)

I created my textbox using the drawing toolbar, I wonder if this could be the hold up. Regards, Marc

PS. I'm not sure about this but, perhaps it's also necessary to make a reference to the "Microsoft Excel Object Library" in your VB editor. Go to TOOLS/References and look for it, check it and select OK. HTH
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top