就是只充许他录入数字,不充许录其它字符?

解决方案 »

  1.   

    if isnumeric(text1.text) and instr(text1.text,".")=0 and instr(text1.text,",")=0 then
       msgbox "数字"
    end if
      

  2.   

    if not isnumeric(text1.text) then
        msgbox "请输入数值型数据!",48,"提示"
        text1.setfocus
        exit sub
    end if
      

  3.   

    还可以用ASCII码进行判断
    1=48
    2=49
    3=50
    ...
    ...
    ...
    9=57
      

  4.   

    哈,THANKS。这么常用的函数咋个长时间不用就忘了呢。两人都答对了,咋个办呢?每人10分吧。