ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   separate 2 different lists (https://www.excelbanter.com/excel-discussion-misc-queries/188283-separate-2-different-lists.html)

rlynx

separate 2 different lists
 
I have 2 lists of names and emails, A and B. List A includes list B. Anyone
knows how to separate them quickly. Meaning list A minus list B?

Bob Phillips

separate 2 different lists
 
Dim LastRow As Long
Dim i As Long

With ActiveSheet

LastRow = .cells(.Rows.Count, "A").End(xlUp).Row
For i = LastRow To 1 Step -1

If Not IsError(Application.Match(.cells(i, "A").Value,
..Columns(2),0)) then

.Cells(i, "A").Delete Shift:=xlShiftUp
End If
Next i
End With

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"rlynx" wrote in message
...
I have 2 lists of names and emails, A and B. List A includes list B. Anyone
knows how to separate them quickly. Meaning list A minus list B?





All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com