![]() |
Textbox format
How do I get a textbox to only allow numbers
Thanks in advance Greg |
Textbox format
Hi Greg
You could use the Keypress event from your textbox and then using the KeyAscii, check each input allowing only numbers. HTH Cordially Pascal "Greg B" a écrit dans le message de ... How do I get a textbox to only allow numbers Thanks in advance Greg |
Textbox format
Sorry to be a pain how do I do that?
Thanks again Greg |
Textbox format
Greg,
This allows numbers, - and .. Adjust to suit Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 48 To 57 'Nos 0 - 9 Exit Sub Case 45, 46 ' - and . Exit Sub Case Else Application.EnableEvents = False KeyAscii = 0 Application.EnableEvents = True Beep End Select End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Greg B" wrote in message ... Sorry to be a pain how do I do that? Thanks again Greg |
Textbox format
thanks Bob for your help
Greg |
All times are GMT +1. The time now is 10:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com