You can split text in both textboxes into 2 arrays then compare them to remove duplicate lines.
This is another way:
Code:
Private Sub Command1_Click()
Dim sText1 As String, sText2 As String
Dim sItems() As String, i As Long
'-- copy and add first and last delimiters
sText1 = vbLf & Text1.Text & vbCr
'-- split Text2.Text by vbCrLf
sItems = Split(Text2.Text, vbCrLf)
'-- check existing of each item
sText2 = ""
For i = 0 To UBound(sItems)
'-- surround sItems(i) with vbLf and vbCr then check
If InStr(sText1, vbLf & sItems(i) & vbCr) = 0 Then
'-- sItem2(i) does not exist in sText1, add it to sText2
sText2 = sText2 & vbCrLf & sItems(i)
End If
Next
'-- remove leading vbCrLf and copy to Text2.Text
Text2.Text = Mid$(sText2, 3)
End Sub