Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Textbox filling cells

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Textbox filling cells

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


--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"jnf40" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling in blank cells with information from cells above it tracytracy123 Excel Discussion (Misc queries) 1 June 22nd 09 11:04 PM
Filling cells TripleX Excel Programming 4 April 4th 07 02:32 PM
Filling cells jnf40 Excel Programming 2 September 7th 06 07:22 AM
Filling cells JohnS Excel Programming 2 September 30th 04 09:07 AM
Filling a textbox with text in another cell Charles Excel Programming 2 August 19th 04 01:32 AM


All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"