Another VBA solution:
Option Explicit
Sub sCopyEMailAddresses()
Dim lLR As Long
Application.ScreenUpdating = False
' using sheet1 ...
With Sheet1
' determine how many rows of data (based on column A)
lLR = .Range("A" & .Rows.Count).End(xlUp).Row
' add helper formula in column C
.Range("C2:C" & lLR).Formula = _
"=COUNTIF($A$2:$A2,$A2)"
' filter the records
With .Range("$A$1:$C$" & lLR)
.AutoFilter
.AutoFilter _
Field:=3, _
Criteria1:="<=3"
End With
End With
' prepare sheet2 ...
With Sheet2
' clear existng data
.Cells.Delete
End With
' back on sheet1 ...
With Sheet1
' copy visble cells in columns A and B to sheet2
With .Range("$A$1:$B$" & lLR)
.SpecialCells(xlCellTypeVisible).Copy _
Sheet2.Range("A1")
' switch off the filter
.AutoFilter
' remove the helper column
.Range("C1").EntireColumn.Delete
End With
End With
' and back on sheet2 ...
With Sheet2
' make the columsn the right width
.Range("A1:B1").EntireColumn.AutoFit
End With
Application.ScreenUpdating = True
End Sub
Regards, TMS
Bookmarks