LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to create a check to allow user to input numerics from the numeric pad

Private Sub txtZip_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
' Pass through only digits.
If KeyCode < 48 Or KeyCode 57 Then
KeyCode = 0
Beep
End If

' As I found out the numerics from the numeric pad range from 0x60 to
0x69
' Could someone show me how to set up a valid check for them ?
If KeyCode < "0x60" Or KeyCode "0x69" Then
KeyCode = 0
Beep
End If


End Sub

 
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
Create a user input query so it can be added on the switchboard? Star Taylor Excel Discussion (Misc queries) 3 May 31st 07 08:43 PM
Check user input [email protected] Excel Programming 3 March 24th 06 09:04 AM
check is input textboxes is numeric on userform Jean-Pierre D via OfficeKB.com Excel Programming 7 August 16th 05 08:15 PM
Check a user-input value against a list of values? Bill_S Excel Programming 1 April 28th 05 03:24 AM
create a user input form Travis Excel Programming 2 January 6th 04 04:13 PM


All times are GMT +1. The time now is 01:18 PM.

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"