LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default user form - how to set it up so it stores data when you press

You could do it like this which detects the enter key being pressed

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode < 13 Then Exit Sub
mysheet = "Sheet1"
lastrow = Sheets(mysheet).Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
Cells(lastrow, 1).Value = TextBox1.Text
End Sub

Mike

"NDBC" wrote:

Thanks for the replys but neither are quite what I wanted. I can do what both
examples do. That is put in the text box and have a button that does the
command to store the entered data.

What a want is a form with only the text box so that when you hit enter the
data is stored. I don't want to have to either click on the button or press
enter twice.

Can this be done.



 
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
User Form - Get Data From Drop List Tony Excel Discussion (Misc queries) 0 January 7th 08 08:54 PM
User form Samples (to query data) Matts Excel Discussion (Misc queries) 0 October 10th 07 05:15 PM
How can I make the cursor move down 8 cells each time I press ente Cadnys Kisses Setting up and Configuration of Excel 2 August 17th 07 08:08 PM
How can I make the cursor move down 8 cells each time I press ente Cadnys Kisses Setting up and Configuration of Excel 0 August 10th 07 08:50 PM
How do i fill the adjacent cell formulas in user form when i press Vicky Excel Discussion (Misc queries) 0 June 5th 06 07:38 AM


All times are GMT +1. The time now is 10:43 PM.

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

About Us

"It's about Microsoft Excel"