作者:乔山办公网日期:
返回目录:excel表格制作
DIM a As Integer
a=0
If range("E1")=2
a=a+10
end if
If range("E2")=2
a=a+10
end if
If range("E3")=4
a=a+10
end if
If range("E4")=2
a=a+10
end if
MsgBox "得分:"&a
81个textbox 弄成控件zhidao数组版textbox(),然后
for i=0 to 79
if not IsNumeric(textbox(i).text) then
msgbox "第" & i & ”个textbox框输入非数字权"
exit for
end if
next
以A1单元zhidao格为样版本
Application.IsText(Cells(1, 1)) = True "文本"
IsNumeric(Cells(1, 1)) = True "数值权"
IsDate(Cells(1, 1)) = True "日期"
这里假设你的那个按钮的名字叫来源Button,然后把下面的代码放进去就可以了(已测试!百)
Private Sub Button_Click()
Dim i As Variant
i = InputBox("请输入一个数字", "数字录入中度", 1)
If IsNumeric(i) = False Then
MsgBox "你输入的不知是数值,请重新道输入", , "输入错误!"
i = InputBox("请输入一个数字", "数字录入中", 1)
End If
End Sub