Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have created the following code to only allow numeric values (an decimal point) into TextBox1. Private Sub Textbox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case Asc("0") To Asc("99") Case Asc(".") If InStr(1, TextBox1.Text, ".") 0 Then KeyAscii = 0 End If Case Else KeyAscii = 0 End Select End Sub The problem is this allow the entry of the decimal point alone. Thi causes a '#VALUE' error in the target cell which in turn causes th code to halt and bring up the debug form. How do I modify this code so that if the user attempts to enter th decimal point without a trailing number the value gets turned to Null -- SimonBianch ----------------------------------------------------------------------- SimonBianchi's Profile: http://www.excelforum.com/member.php...fo&userid=3729 View this thread: http://www.excelforum.com/showthread.php?threadid=57011 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validation Question | Excel Worksheet Functions | |||
Validation Question | Excel Discussion (Misc queries) | |||
Question on Validation | Excel Worksheet Functions | |||
validation question | Excel Discussion (Misc queries) | |||
Validation Question....Can this be done? | Excel Discussion (Misc queries) |