vb 怎么实现 text2.text = text1.text中的数字

例如 text1.text=y8lh9 则 text2.text=89

Private Sub Text1_Change()
    Dim i, s
    s = ""
    For i = 1 To Len(Text1)
        If Mid(Text1, i, 1) >= "0" And Mid(Text1, i, 1) <= "9" Then
            s = s + Mid(Text1, i, 1)
        End If
    Next i
    Text2 = s
End Sub

温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜