Getting data from user form into spreadsheet

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

Hi There.
I have been using excel for a number of years & I'm just beginning to
dabble with VBA so I am really raw.
Can any one tell me how I get my data from a text box in a user form
into my spreadsheet.
For example
TextBox1 data = 4.5 TextBox data = 3 and TextBox data = 10
I want this data to appear in sheet4 cells D126, E126 & F126
 
Place a button on your userform with this code in the
click event

Private Sub CommandButton1_Click()
Sheets("Sheet4").Range("D126").Value = Me.TextBox1.Text
Sheets("Sheet4").Range("E126").Value = Me.TextBox2.Text
Sheets("Sheet4").Range("F126").Value = Me.TextBox3.Text
End Sub
 
You can set the CopntrolSource Property of Textbox equal to Named range on a
worksheet or or Celladdress

Rajan
 
Back
Top