Private Sub Command1_Click()
Dim a1() As String, a2() As String, a3() As String, a4() As String
Dim i As Integer, j As Integer
a1 = Split(Text1.Text, " ")
a2 = Split(Text2.Text, vbCrLf)
For i = 0 To UBound(a2)
a3 = Split(a2(i), " ")
If UBound(a3) >= 0 Then
a4 = Filter(a1, a3(0), False)
For j = 1 To UBound(a3)
a4 = Filter(a4, a3(j), False)
Next
a2(i) = Join(a4, " ")
End If
Next
Text3.Text = Join(a2, vbCrLf)
End Sub
replace函数+循环 可以帮到你
用循环,把文本框二里面的数据,一个一个拿出来去跟文本框1的数据比较,如果文本框一里面有的话,就替换为空,这样,循环结束之后,就剩下文本框二没有的啦。比如
文本框1有1 2 3 4 5 文本框2有2 4 5
处理之后,就是1 3了