I have a list of email addresses in column A and B. All the email addresses in column B (the shorter list) is included in column A. How can I print in column C, the email addresses included in column A and NOT in column B.
THANKS!!
Printable View
I have a list of email addresses in column A and B. All the email addresses in column B (the shorter list) is included in column A. How can I print in column C, the email addresses included in column A and NOT in column B.
THANKS!!
[vba]
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim LastRow As Long
Dim NextRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To LastRow
If IsError(Application.Match(.Cells(i, TEST_COLUMN).Value, .Columns(2), 0)) Then
NextRow = NextRow + 1
.Cells(i, TEST_COLUMN).Copy Worksheets("Sheet2").Cells(NextRow, "A")
End If
Next i
End With
End Sub
[/vba]
Thanks, but the results are not printing on column C.
Missed that bit
[vba]
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim LastRow As Long
Dim NextRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To LastRow
If IsError(Application.Match(.Cells(i, TEST_COLUMN).Value, .Columns(2), 0)) Then
NextRow = NextRow + 1
.Cells(i, TEST_COLUMN).Copy .Cells(NextRow, "C")
End If
Next i
End With
End Sub
[/vba]
Thanks a bunch. You are very talented