Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning a sub to a specific keybordkey
Hi!
I have a userform in Excel (version 2000) which has a textbox (txtInvoice) and a listbox (lstInvoices). When the user, after typing the invoicenumber into the textbox, presses the Enter-key (on the numerical keypad) the number should be added to the listbox. How do I assign the sub that does the transfer to the Enter-key? TIA PO |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Assigning a sub to a specific keybordkey
"PO" <po wrote in message ...
Hi! I have a userform in Excel (version 2000) which has a textbox (txtInvoice) and a listbox (lstInvoices). When the user, after typing the invoicenumber into the textbox, presses the Enter-key (on the numerical keypad) the number should be added to the listbox. How do I assign the sub that does the transfer to the Enter-key? TIA PO PO Try this.. '''' After user enter info they press Tab or Return key the if statement will evaluate which key and proceed'''' Private Sub txtInvoice_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) 'tab key If KeyCode = "9" Or KeyCode = "13" Then ''''''''Your code goes here'''''' End If End Sub HTH Charles |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Header & Footers in Templates - Assigning workbook specific | Excel Discussion (Misc queries) | |||
assigning # to day | Excel Worksheet Functions | |||
Assigning a Value | Excel Discussion (Misc queries) | |||
Link from a specific Cell in Excel to a specific para. in Word | Excel Worksheet Functions | |||
Assigning a value to a name | Excel Worksheet Functions |