PASSING DATA FROM USER FORM TO EXCEL SPREADSHEET
Bit different to what you initially asked!
Is This what you want?
Private Sub cmdCommit_Click()
iRow = Cells(Rows.Count, "A").End(xlUp).Row
If iRow = 1 And Range("A1") = "" Then
iRow = 1
Else
iRow = iRow + 1
End If
ThisWorkbook.Sheets("Sheet1").Cells(iRow, "A").Value =
frmRGAInput.txtRGANum.Value
End Sub
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
wrote in message
...
You can also place this line in the click event of a
button on the userform
ThisWorkbook.Sheets("Sheet1").Range("a1").Value =
Me.TextBox1.Value
That is my intention.
the workbook is called book1 and the worksheet is called
sheet1.
column 1 is where I want to place the RGA number.
my userform is called frmRGAInput and the text box on the
form for the RGA number is called txtRGANum
I entered:
Private Sub cmdCommit_Click()
ThisWorkbook.Sheets("Sheet1").Range("a1").Value =
frmRGAInput.txtRGANum.Value
End Sub
and it worked, how do I set it up so that every time I
click the OK button it enters the data on the next row of
the excel sheet?
Also, how can i get this specific form to pop up when
Book1 is openned?
|