Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question - how to "link" a Text box link to a cell reference.

Status
Not open for further replies.
Jun 25, 2002
2
US
Starting out, I have a Dialog Box with a Text Box that I am trying to use for user input. (I am new to this so, I am not certain I am using the right control.) If a user updates the value in the text box, I need the value to "link" (via VBA) to a R1C1 cell reference or "cell". I am not sure I said that right, but you probably see where I am going. Any hints?
 
Assuming that the text box is referenced as textbox1, try this

sheets(1).cells(1,1).value = Userform1.textbox1.value

I am taking that the text box is on the form.

This refers the value of the text box to cells A1 . Use this in the text box change event.

I am also new to this, but a try is worth it.

Ram P
 
By your usage of "Dialog box" are you using excel 95 ?? if so, the coding is slightly different to that which Ram posted, which will work very nicely for 97 and onwards.
If you are using e95, I should be able to help as I can still (vaguely) remember the coding structure
Rgds
Geoff
 
Awesome. Office 2000 is where I am coding. I will give it a shot. Thanks to both of you.
 
Range("Sheet1!A1").value = UserForm1.TextBox1.value
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top