Textbox filling cells

J

jnf40

Is there a way to modify this code where the cells that are populated with
the Textbox1.Text are cells A1 through A8

Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = ActiveSheet.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = TextBox1.Text
MsgBox "One Passenger Added"
response = MsgBox("Do you want to enter another Passenger?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
 
J

John Bundy

See if this does what you ask, only does cells A1 to A8 and doesn't ask the
questions since you said you wanted them for sure. Still unloads.
Private Sub CommandButton1_Click()
For i = 1 to 8
Cells(i,1)= TextBox1.Text
Next
Unload Me
End Sub
 

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