文本框只能输入数字(文本框只能输入数字和小数点)
VBA文本框如何限制只输入数字 .和-
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If (48 <= KeyAscii And KeyAscii <= 57) Or KeyAscii = 45 Or KeyAscii = 46 Then
Debug.Print "输入正确"
Else
KeyAscii = 0
MsgBox ("输入不正确")
End If
End Sub
- 本文固定链接: http://news.x86android.com/articles/1160964.html
- 转载请注明: zhiyongz 于 知识百科-X86安卓中文站 发表
《本文》有 0 条评论