It's not pretty, I'm a novice, but it works.
Sub EmailListingThingy()
Dim AcolCntr As Long
Dim BcolCntr As Long
Dim A_LastRow As Long
Dim B_LastRow As Long
Dim FoundDuplicate As Boolean
Dim Temp_C_RowCntr As Long
Dim Append_A_Cntr As Long
'YourSheetNameHere.Activate
Columns("A:A").Sort Key1:=ActiveSheet.Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("B:B").Sort Key1:=ActiveSheet.Range("B1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
A_LastRow = 1
Do Until Range("A" & A_LastRow).Value = ""
A_LastRow = A_LastRow + 1
Loop
A_LastRow = A_LastRow - 1
B_LastRow = 1
Do Until Range("B" & B_LastRow).Value = ""
B_LastRow = B_LastRow + 1
Loop
B_LastRow = B_LastRow - 1
Temp_C_RowCntr = 1
Append_A_Cntr = A_LastRow + 1
For BcolCntr = 1 To B_LastRow
FoundDuplicate = False
For AcolCntr = 1 To A_LastRow
If Trim(Range("A" & AcolCntr).Value) = _
Trim(Range("B" & BcolCntr).Value) Then
FoundDuplicate = True
Exit For
End If
Next
If FoundDuplicate = False Then
Range("A" & Append_A_Cntr).Value = _
Trim(Range("B" & BcolCntr).Value)
Range("C" & Temp_C_RowCntr).Value = _
Trim(Range("B" & BcolCntr).Value)
Temp_C_RowCntr = Temp_C_RowCntr + 1
Append_A_Cntr = Append_A_Cntr + 1
End If
Next
Columns("B:B").Delete Shift:=xlToLeft
Columns("A:A").Sort Key1:=ActiveSheet.Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Columns("B:B").Sort Key1:=ActiveSheet.Range("B1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
This message was edited by TsTom on 2002-03-20 02:53