I am trying to take information froma user form and submit it to my sheet 1
and every time a new record is entered it must go on to a new row. can anyone
help?!
I am trying to take information froma user form and submit it to my sheet 1
and every time a new record is entered it must go on to a new row. can anyone
help?!
Hi Darren
Place the code in the userform of the button that you will be using to add
the info
Private Sub CommandButton1_Click()
Dim nextrow As Integer
nextrow = FirstBlankRow(1, 1)
Cells(nextrow, 1) = txtEmployeeName
Cells(nextrow, 2) = txtSSN
Cells(nextrow, 3) = txtAddress
Cells(nextrow, 4) = txtCity
End Sub
Function FirstBlankRow(KeyColumn As Integer, startrow As Long) As Long
Dim i As Long
i = 0
Do While ActiveSheet.Cells(startrow + i, KeyColumn).Text <> ""
i = i + 1
Loop
FirstBlankRow = startrow + i
End Function
Bob
"Darren" wrote:
> I am trying to take information froma user form and submit it to my sheet 1
> and every time a new record is entered it must go on to a new row. can anyone
> help?!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks