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!

Userform output to cell

Status
Not open for further replies.

fezzer

Technical User
Mar 20, 2002
14
GB
I'm sorry if this has already been covered - I couldn't find an appropriate thread.

Basically the situation is this. I'm in Excel and have set up a user form which is activated with a button. There are a load of simple text fields which will get filled in. These will then be put into certain cells when the ok button is pressed. Should be easy i know.... Oh and is it possible to set the default value of each field as the present value of that cell so if the user makes a mistake it can be loaded up again and they'd only have to correct that one field.

Thanks

Fez
 
Here's one way:
[blue]
Code:
Private Sub UserForm_Initialize()
  TextBox1.Text = [A1]
  TextBox2.Text = [A2]
  TextBox3.Text = [A3]
End Sub

Private Sub CommandButton1_Click()
  [A1] = TextBox1.Text
  [A2] = TextBox2.Text
  [A3] = TextBox3.Text
  UserForm1.Hide
End Sub
[/color]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top