Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
Excel Header & Footers in Templates - Assigning workbook specific DeePee Excel Discussion (Misc queries) 0 June 19th 08 05:52 PM
assigning # to day bmo Excel Worksheet Functions 3 October 17th 07 11:16 PM
Assigning a Value KaraSuzanne Excel Discussion (Misc queries) 3 August 17th 07 05:34 PM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Assigning a value to a name Charli Excel Worksheet Functions 2 November 24th 04 08:50 PM


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