ActiveX文本框Sheet1

问题描述

我在UserForm中运行的宏存在问题 我也想将其应用于textBox活动控件中的sheet1。我有一个问题,如何更改代码以在sheat1中工作?

Option Explicit

Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
   If Not IsNumeric(Chr(KeyAscii)) And Not KeyAscii = 8 Then
      KeyAscii = 0
   End If
End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If TextBox1.Value = "" Then
Exit Sub
End If
   If Val(TextBox1.Text) < 100 Or Val(TextBox1.Text) > 999 Then
      MsgBox "Error"
      Cancel = True
   End If
End Sub

Private Sub UserForm_Click()

End Sub

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)