bluebug_04=not ( asc(str2)>=49 and asc(str2)<=59 )

解决方案 »

  1.   

    WxmJun(FBI) 你实现的是那个变量如果是数字就错!我说的是字符中只要夹带数字就报错!如果都是字符就正确!
      

  2.   

        For i = 1 To 9
            if InStr(1,str1, i) >0 then BLueBUG_04 = False : exit sub
        Next i从你的程序看,0是被允许的?
      

  3.   

    Private Sub Form_Load()
    Dim a As String
    Dim b As Boolean
    a = "aassssa"
    b = BLueBUG(a)End Sub
    Function BLueBUG(str1 As String) As Boolean
    Dim str As String
        For i = 1 To Len(str1)
            If IsNumeric(Mid(str1, i, 1)) Then
                BLueBUG = False
                Exit Function
            End If
        Next i
        BLueBUG = True
    End Function
      

  4.   

    现在我发现IsNumeric就可以实现了哦,,,,
      

  5.   

    还是我的方法比较好,简洁,效率高,你仔细看一下吧Function BLueBUG_04(str1 As String) As Boolean
        BLueBUG_04 = false
        For i = 1 To 9
            if InStr(1,str1, i) >0 then  exit sub
        Next i
        BLueBUG_04 = True
    End Function
      

  6.   

    sorry 
    exit sub 改为 exit function
      

  7.   

    fuxc(Michael) ,我觉得你的确实不错,值得大家学习
      

  8.   

    fuxc(Michael)真快呀!你使的可也是我的看家本领嘛