text1.text= 123456789#@0000000
如何删除在#@后面的所有字符包括#@
前面位数不一定是9位~~
这个要怎么做??谢谢

解决方案 »

  1.   

    如果在你的程序中这样的处理不多的话,用Split分开取吧
      

  2.   

    strVal = "123456789#@0000000"
    text1.text = left(strval, instr(strval,"#@") -1)
      

  3.   

    Option ExplicitPrivate Sub Command1_Click()
        Dim strTmp As String
        
        strTmp = "123456789#@0000000"
        MsgBox Left(strTmp, InStr(strTmp, "#@") - 1)
    End Sub
      

  4.   

    instr判断“#@”的位置然后left取前面的字符串。
      

  5.   

    Dim Select_String as stirng '存储选取的字符串
    Dim Select_Long as Long  '存储选取字符串的的位置
    Select_Long=instr(text1.text,"#@")-2 
    Select_String=left(text1.text,Select_Long)
      

  6.   

    strVal = "123456789#@0000000"
    text1.text = left(strval, instr(strval,"#@") -1)
      

  7.   

    Private Sub Command1_Click()
        Dim arr As Variant, strVal As String
        strVal = "123456789#@0000000"
        arr = Split(strVal, "@")
        MsgBox arr(0)
    End Sub