View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
susan susan is offline
external usenet poster
 
Posts: 10
Default How to pass data from UserForm to spreadsheet

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