Simply change this line
Code:
--------------------
LastRow.Offset(13, 1).Value = TextBox2.Text
--------------------
for this
Code:
--------------------
LastRow.Offset(14, 0).Value = TextBox2.Text
--------------------
the (13, 1) means 13 rows down 1 column across changing it to (14,0) is
14 rows down but none across just like your first textbox.
bo2loz el meba2laz;306804 Wrote:
on excel 2007, i have a visual basic code for an interface that contains
2
pushbuttons and 2 text boxes. the code for the one of the pushbuttons
is as
follows:
Code:
--------------------
Private Sub CommandButton1_Click()
Dim LastRow As Object
Set LastRow = Sheet1.Range("a65536").End(xlUp)
LastRow.Offset(13, 0).Value = TextBox1.Text
LastRow.Offset(13, 1).Value = TextBox2.Text
MsgBox "One record written to Sheet1"
response = MsgBox("Do you want to enter another record?", _
vbYesNo)
If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
Else
Unload Me
End If
End Sub
--------------------
in the second line of the program ive got 'End(xlUp)' which makes my
second
input into the text boxes appear 10 cells below the first input. i
want to
make my seecond input appear a cell below the first input. HOW
??????? :))
--
Simon Lloyd
Regards,
Simon Lloyd
'The Code Cage' (
http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile:
http://www.thecodecage.com/forumz/member.php?userid=1
View this thread:
http://www.thecodecage.com/forumz/sh...ad.php?t=85785