Hi there.
This procedure can get quite complicated but I have a sample of code that might work. It assumes that the unique identifier is the first field in each record i.e strArray1(0) and strArray2(0). It compares each record identifier and if the numbers are out of sync then it writes the missing record to the diffs file. This will work if a record is deleted from either file. It will also check the differences and any new records added to the end of either file. (N.B. this procedure assumes that you will have less than 999999999 records in each file, otherwise, increase this value)
Private Sub btnCompare_Click()
Dim strRecord1 As String, strRecord2 As String
Dim strArray1 As Variant, strArray2 As Variant
Open "c:\file1.csv" For Input As #1
Open "c:\file2.csv" For Input As #2
Open "c:\diffs.csv" For Append As #3
Do
If EOF(1) Then
strArray1(0) = 999999999
Else
Line Input #1, strRecord1
strArray1 = Split(strRecord1, ","

End If
If EOF(2) Then
strArray2(0) = 999999999
Else
Line Input #2, strRecord2
strArray2 = Split(strRecord2, ","

End If
Do While strArray1(0) < strArray2(0)
Print #3, strRecord1
If EOF(1) Then
strArray1(0) = 999999999
Else
Line Input #1, strRecord1
strArray1 = Split(strRecord1, ","

End If
Loop
Do While strArray1(0) > strArray2(0)
Print #3, strRecord2
If EOF(1) Then
strArray1(0) = 999999999
Else
Line Input #2, strRecord2
strArray2 = Split(strRecord2, ","

End If
Loop
If (strArray1(0) = strArray2(0)) And (strArray1(0) <> 999999999 And strArray2(0) <> 999999999) Then
If RecordIsDifferent(strArray1, strArray2) = True Then Print #3, strRecord2
End If
Loop Until EOF(1) And EOF(2)
Close #1, #2, #3