Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kel
 
Posts: n/a
Default User Form in VB = TextBox

Hi again

I crated a User Form in VB and added a TextBox and i want the user to be
able to enter 'Numbers only' not characters can anyone provide info please,
if the user is trying to input other then numbers give no respond.

thnx in advance
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Something like:

Option Explicit
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)

Select Case KeyAscii
Case Asc("0") To Asc("9")
'do nothing
Case Else
Beep
KeyAscii = 0
End Select

End Sub



Kel wrote:

Hi again

I crated a User Form in VB and added a TextBox and i want the user to be
able to enter 'Numbers only' not characters can anyone provide info please,
if the user is trying to input other then numbers give no respond.

thnx in advance


--

Dave Peterson
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
Use a text box to calculate and show results in a user form stockpick Excel Discussion (Misc queries) 6 August 6th 05 07:04 AM
Print scrollable user form. cparsons Excel Discussion (Misc queries) 2 August 4th 05 05:45 PM
user form static69 Excel Discussion (Misc queries) 1 February 6th 05 09:43 PM
Data Entry Alert in User Form Kev Excel Discussion (Misc queries) 6 January 8th 05 04:01 PM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 06:57 PM


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