Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default how to input data into textboxes and make it appear on excel cells

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:


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 ??????? :))
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 515
Default how to input data into textboxes and make it appear on excel cells

Cannot see it ending up 10 rows down? You are instructing it to enter data
13 rows down, therefore 12 below the last entry. If you change the 13 to 1,
you should write to the next line.

--
HTH

Kassie

Replace xxx with hotmail


"bo2loz el meba2laz" 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:


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 ??????? :))

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to input data into textboxes and make it appear on excel cells


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default how to input data into textboxes and make it appear on excelcells

On Apr 14, 8:09*am, Simon Lloyd
wrote:
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.


NON SENSE...

Just do what Kassie suggested.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default how to input data into textboxes and make it appear on excel c

thanks a lot, it WORKED :))

"Kassie" wrote:

Cannot see it ending up 10 rows down? You are instructing it to enter data
13 rows down, therefore 12 below the last entry. If you change the 13 to 1,
you should write to the next line.

--
HTH

Kassie

Replace xxx with hotmail


"bo2loz el meba2laz" 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:


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 ??????? :))



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 515
Default how to input data into textboxes and make it appear on excel c

Thanks DK

--
HTH

Kassie

Replace xxx with hotmail


"dk" wrote:

On Apr 14, 8:09 am, Simon Lloyd
wrote:
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.


NON SENSE...

Just do what Kassie suggested.



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
How to clear multiple cells of input data in Excel simultaneously sstea Excel Worksheet Functions 12 May 2nd 09 08:47 PM
How do I make the auto fill handle to input data from left to righ Jason Excel Discussion (Misc queries) 2 March 12th 08 10:27 PM
Show Results in TextBoxes, ONLY if All TextBoxes have Data in them RyanH Excel Programming 3 November 19th 07 03:30 PM
Data input in cells RichP Excel Discussion (Misc queries) 8 March 19th 06 09:56 PM
check is input textboxes is numeric on userform Jean-Pierre D via OfficeKB.com Excel Programming 7 August 16th 05 08:15 PM


All times are GMT +1. The time now is 07:27 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"