用转换函数时,当然会提示类型出错但那检测语句是怎样写,是不是: if cdbl(text1.text) < 0 then ... endif 好像不行!
或者自己写个函数,如果含有数字返回True,否则FalseFunction FInStr(nStr As String) As Boolean Dim i As Long For i = 0 To 9 If InStr(nStr, LTrim(Str(i))) > 0 Then FInStr = True Exit Function End If Next
用转换函数时,当然会提示类型出错但那检测语句是怎样写,是不是:
if cdbl(text1.text) < 0 then
...
endif
好像不行!
Dim i As Long
For i = 0 To 9
If InStr(nStr, LTrim(Str(i))) > 0 Then
FInStr = True
Exit Function
End If
Next
FInStr = False
End Function