以下代码调试通过,注意数字间用空格隔开
Private Sub Command1_Click()
Dim numArr1
Dim numArr2
Dim i As Integer
numArr1 = Split(Text1.Text, " ") ‘如果用逗号隔开就应该是Split(Text1.Text,",")
numArr2 = Split(Text2.Text, " ")
For i = 0 To UBound(numArr1)
If InStr(Text2.Text, numArr1(i)) = 0 Then Text3.Text = Text3.Text & numArr1(i) & " "
Next
For i = 0 To UBound(numArr2)
If InStr(Text1.Text, numArr2(i)) = 0 Then Text3.Text = Text3.Text & numArr2(i) & " "
Next
End Sub