Copy & Paste Conditional Formatted duplicates w/vba

H

Howard

Excel 2010

I have a large list of names/words with a X - O binary code next to each name/word. The columns with the XO codes is conditional formatted to show duplicates. In this example 1 & 2 are CF highlighted as the O's are accounting for the letter N in both names and just happen to be the same X-O code. In 3 and 4 the O's are accounting for the letter D in both names but are not duplicates codes. (Somewhere else in the list the O is accounting for theO's in both names and they also are not duplicates codes.)


1. XXXO XXXXXO JOHN DRYDEN
2. XXXO XXXXXO JOAN DIDION

3. XXXX OXXOXX JOHN DRYDEN
4. XXXX OXOXXX JOAN DIDION

Is there some method using VBA to go through a column and identify the JOHNand JOAN duplicate codes and then copy & paste one of them (code & name) to a fresh column. There could be several "JOHN-JOAN" like duplicates in thecolumn.

Something like:

Dim i As Interger
Dim JohnCode As String
Dim JoanCode As String
Dim c As Range
Dim Coder As Range

With Selection
For Each c in Range("Coder")
If JohnCode = JoanCode then
JohnCode.c Resize(1,2).Copy Range("B100").End(xlup).Offset(1,0)
End If
Next
End With

I've looked through HELP and fooled around with the FIND-REPLACE feature but CF seems to be immune to 'normal' look-see-copy-paste.

Thanks.
Regards,
Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top