Two nonadjacent columns, Column A and C, contain strings and Column E (again nonadjacent) should contain the duplicate strings between Column A and C.
Now my main problems is that Columns A and C are different lengths and the duplicates aren’t per se on the same row.
When not using VBA, the following input Column E gives the solution except for the blanks.
=IF(ISERROR(MATCH(A1,$C:$C,0)),"",A1)
For example:
Column A
potatoe
tomatoe
broccoli
pepper
mushroom
Column C
mushroom
cucumber
broccoli
salt
fennel
Column E should be
mushroom
broccoli
This is what I’ve been able to find so far, but it is very wrong. I just find myself unable to breakdown the issue.
Sub Duplicates()
Dim duplicates As Range
Set duplicates = Columns("A", "C")
activesheet.duplicates.Copy Destination:=activesheet.Range("E1")
End Sub
… Try this: