张志峰的博客

水滴石川,积少成多。

导航

VBA 代码控制只能输入浮点数

Posted on 2012-04-11 18:27  ╰★张志峰★╮  阅读(473)  评论(0编辑  收藏  举报

Public Sub EditInterval_KeyPress(KeyAscii As Integer)
 If ((KeyAscii >= 48) And (KeyAscii <= 57)) Or (KeyAscii = 46) Or (KeyAscii = 8) Then

    Else
  KeyAscii = 0
     Exit Sub

 End If
End Sub

Public Sub EditWarning_Click()

End Sub

Public Sub EditWarning_KeyPress(KeyAscii As Integer)
 If ((KeyAscii >= 48) And (KeyAscii <= 57)) Or (KeyAscii = 46) Or (KeyAscii = 8) Then

    Else
  KeyAscii = 0
     Exit Sub

 End If

End Sub