View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Deen Deen is offline
external usenet poster
 
Posts: 22
Default In textbox required only number without decimal


Hi,

Please see the below coding, This working fine, But is accepting the decimal
value also(.),

What i required is when ever i type dot(.) it need to show msg "Please Enter
Correct Number"

Eg:1) 6161.8976, 2)98450.0, 3)8.874 need to show msg "Please Enter Correct
Number" and delete the what ever typed that means nullstring in that textbox.

Private Sub TextBox11_Change()
Worksheets("FOR").Activate
Range("C1").Select
Range("C1").Value = TextBox11.Value
If Not IsNumeric(TextBox11.Value) And TextBox11.Value < vbNullString Then
MsgBox "Please Enter Correct Number"
TextBox11.Value = vbNullString
End If
End Sub

I'm very newbie for this coding. please anyone can help me on this.

Thanks in advance
Deen