vb中统计数字的和
,怎么在输入的一串东西如:ab12a25c12 只统计数字的和?代码怎么做
回复 2楼 lianyicq
Private Sub Command1_Click()Dim i As Integer
Dim n As Integer
For n = 0 To 9
Text1(n).Text = n + 1
If Text11(n).Text = 0 Then Exit For
Next n
For i = 0 To 9
If Text21(i).Text = "*" Then Text11(i).ForeColor = vbRed
If Text21(i).Text = "#" Then Text11(i).ForeColor = vbGreen
Text32.Text = Text31.Text & "股道" & Chr(13) & Chr(10) & Text11(0).Text & Text11(1).Text & Text11(2).Text & Text11(3).Text & Text11(4).Text & Text11(5).Text & Text11(6).Text & Text11(7).Text & Text11(8).Text & Text11(9).Text
Next i
End Sub
为什么我在text11中输入数字不出现错误,输入a3时怎么就出现 类型不匹配了?