Can I do this?

G

Guest

I created an input text boxes to collect name and social
security number on worksheet1. Then click on a command
button to transfer the name and SSN to worksheet2 and
then leave worksheet 1 blank for the next person to sign
up.

I want to use the single input form on worksheet 1 to
build a database on worksheet 2.

Can I do this?

Thanks
Jim
 
T

Tom Ogilvy

Sure.

When you press the button, find the bottom of the data with

Private Sub CommandButton1_Click()
with Worksheets("Sheet2")
set rng = .Cells(rows.count,1).End(xlup)
End with
With worksheets("Sheet1")
rng.offset(1,0).Value = .Textbox1.Text
.Textbox1.Text = ""
rng.offset(1,1).Value = .Textbox2.Text
.Textbox2.Text = ""
End With
End Sub
 
A

Ajit

You could create two ranges in (collection of cells in a column) , everytime find the last cell with information and add the new information.

There could be two text boxes on the form which you could map with the corresponding ranges on sheet2. Also you could hide sheet2 so that no one could see the data

Another suggestion (Why dont you do the same thing in Access)
 
J

Jim

Thanks!!
-----Original Message-----
Sure.

When you press the button, find the bottom of the data with

Private Sub CommandButton1_Click()
with Worksheets("Sheet2")
set rng = .Cells(rows.count,1).End(xlup)
End with
With worksheets("Sheet1")
rng.offset(1,0).Value = .Textbox1.Text
.Textbox1.Text = ""
rng.offset(1,1).Value = .Textbox2.Text
.Textbox2.Text = ""
End With
End Sub


--
Regards,
Tom Ogilvy




.
 
Top