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: 57
Default 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
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
Decimal Points Jim Wyns[_2_] New Users to Excel 2 July 21st 08 03:41 PM
How can I convert decimal commas to decimal points? Peteylepieu Excel Discussion (Misc queries) 1 October 2nd 07 10:18 PM
Aligning Decimal Points with non-numeric data notloiseweiss Excel Discussion (Misc queries) 3 November 11th 05 10:17 PM
Decimal Points Leanne Excel Worksheet Functions 1 June 28th 05 02:30 AM
Decimal points not needed Paul K. Excel Worksheet Functions 1 June 3rd 05 02:51 PM


All times are GMT +1. The time now is 05:23 AM.

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"