Hi A.R
Here is some code, that I have not tested. It assumes your data is in Columns A:C with Column A having the Company names. It also assumes Column D is empty and you have a sheet called "Duplicates".
Sub CopyDuplicates()
'Written by OzGrid Business Applications
'www.ozgrid.com
Dim rAllRows As Range
Dim rTake1 As Range
Dim rTake2 As Range
Set rAllRows = Range("A2", Range("A65536").End(xlUp))
rAllRows.Offset(0, 3).FormulaR1C1 = _
"=IF(COUNTIF(C1,RC[-3])>1,1,""no"")"
Set rTake1 = Range("D2:D10000").SpecialCells _
(xlCellTypeFormulas, xlNumbers).Offset(0, -3)
Set rTake2 = Range("D10001", Range("D65536").End(xlUp)).SpecialCells _
(xlCellTypeFormulas, xlNumbers).Offset(0, -2)
Range(rTake1, rTake2).Resize(rTake2.Rows.Count, 3).Select _
Destination:=Sheets("Duplicates").Range("A1")
End sub
Dave
OzGrid Business Applications
Hi A.R
Here is some code, that I have not tested. It assumes your data is in Columns A:C with Column A having the Company names. It also assumes Column D is empty and you have a sheet called "Duplicates".
Sub CopyDuplicates()
'Written by OzGrid Business Applications
'www.ozgrid.com
Dim rAllRows As Range
Dim rTake1 As Range
Dim rTake2 As Range
Set rAllRows = Range("A2", Range("A65536").End(xlUp))
rAllRows.Offset(0, 3).FormulaR1C1 = _
"=IF(COUNTIF(C1,RC[-3])>1,1,""no"")"
Set rTake1 = Range("D2:D10000").SpecialCells _
(xlCellTypeFormulas, xlNumbers).Offset(0, -3)
Set rTake2 = Range("D10001", Range("D65536").End(xlUp)).SpecialCells _
(xlCellTypeFormulas, xlNumbers).Offset(0, -2)
Range(rTake1, rTake2).Resize(rTake2.Rows.Count, 3).Copy _
Destination:=Sheets("Duplicates").Range("A1")
End Sub
Dave
OzGrid Business Applications
Ignore the one directly above here.
OzGrid Business Applications