Userform Values into Excel sheet

D

dezithug

Hi, i am new to VBA, and i created a user form with some radio buttons
and some text boxes. i created some buttons such as next, back and
submit. so my problem is that i want to know if there is a way to
insert the data from the UserForm into a excel sheet in rows so that
i can do some graphs and such when the submit button is pushed.

Thanks in advance.
Aravind
 
G

Guest

G

Guest

You may reference a cell in a number of ways, I use the following:

Workbooks("Book1").Worksheets("Sheet1").Range("A1")=textbox1.text

Substitute Book1 for your workbook's name, Sheet1 with your worksheet's name
and A1 with the cell reference to modify. You may use variables as well. For
example if you have the variable rowNumber as a long you may use the
reference:

Workbooks("Book1").Worksheets("Sheet1").Range("A" & rowNumber)=textbox1.text

If you omit the workbooks("Book1") text the active workbook is used. If you
omit the worksheets("Sheet1") text the active worksheet is used:

Range("A" & rowNumber)=textbox1.text
 

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