text1里自定义 数值,怎么取出来
当text1里包含我特定的文字后
要让他返回出指定数值、
起先我已经定义好:
你好=“15,16,”
上帝=“7,8,9,”
举例,text1=“1,2,3,你好,上帝,”
输出的结果要求text2里是
1,2,3,15,16,7,8,9,
请问怎么弄呢
[解决办法]
Dim AryTex() As String
Dim vI As Integer
AryTex = Split(Text1.Text, ",")
For vI = 0 To UBound(AryTex)
Select Case AryTex(vI)
Case "你好"
AryTex(vI) = "15,16"
Case "上帝"
AryTex(vI) = "7,8,9"
End Select
Next
Text2.Text = Join(AryTex, ",")