Getting data from user form into spreadsheet

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
 
R

Ron de Bruin

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
 
R

Rajan

You can set the CopntrolSource Property of Textbox equal to Named range on a
worksheet or or Celladdress

Rajan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top