Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
I am getting duplicate decimal points on numeric validation
Is there extra code to prevent duplicate decimal points on numeric validation?
This only happens if the first 2 characters are both periods or minus signs. Private Sub Intrate_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case 8 To 10, 13, 27 'Control characters Case 45, 46 ' negative and period If KeyAscii = 45 Then ' hypen/negative If Len(Trim(Intrate.Text)) 1 Then Beep KeyAscii = 0 End If End If If KeyAscii = 45 Then ' hypen/negative If Len(Trim(Intrate.Text)) 1 Then Beep KeyAscii = 0 End If End If Case 48 To 57 'numbers Case Else 'Discard anything else Beep KeyAscii = 0 End Select End Sub Thanks -- AH |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Decimal Points | New Users to Excel | |||
How can I convert decimal commas to decimal points? | Excel Discussion (Misc queries) | |||
Aligning Decimal Points with non-numeric data | Excel Discussion (Misc queries) | |||
Decimal Points | Excel Worksheet Functions | |||
Decimal points not needed | Excel Worksheet Functions |