How to pass data from UserForm to spreadsheet

S

susan

Hi. Ive just been introduced to userforms. Neat! I am familiar with
vba on a beginner level. To keep it simple, I have a userform that
asks for 2 numbers to be iputed into textboxes and I want to pass
that to column 1 and 2. Is there an easy way of doing this so that
the data is sent to the next blank cell on the bottom of column or
top top of column. In the past Ive insert a row so data would be
moved down or searched out the bottom blank cell- VERY inefficient.

Thanks
Mike

Private Sub CommandButton1_Click() ' on user form
Dim b As Single
Dim a As Single
b = TextBox2.Value
a = TextBox1.Value
Cells(1, 1) = a
Cells(1, 2) = b
 

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