writing from inputbox to textbox

bmacias

Board Regular
Joined
Sep 11, 2002
Messages
215
Hi all,

For the life of me I can get this to work. It gives me and "object required" error on the second line. All I'm trying to do is get the name of the person who the fax will be sent to via an input box and paste the information unto a text box that resides on my worksheet.

Please help.

Sub angie()
Dim danny As String

danny = InputBox("Who is the fax for?", "titulo", "Alexis")
TextBox1.Value = danny

End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

agihcam

Well-known Member
Joined
Jan 16, 2006
Messages
1,624
how about including your sheet name where your textbox is;

something like;
Code:
sheets("yoursheetnamehere").TextBox1.Value = danny
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
Try:

Code:
ActiveSheet.TextBox1.Value = danny

HTH,

Smitty
 

Forum statistics

Threads
1,176,447
Messages
5,903,157
Members
435,012
Latest member
Excel for life

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
Top