How do I format duplicate rows between sheets?

Nuke_It_Newport

New Member
Joined
Nov 17, 2020
Messages
47
Office Version
  1. 365
Platform
  1. Windows
Hi everyone-

I have the following code, that compares sheet "Completed" Column A, cell A5 to the last row with sheet "Import" column A, cell A5 to the last row. It then changes the fill color of cells on sheet "Import" column A, cell A5 to last row for any duplicate values found between the two sheets.

VBA Code:
With Sheets("Import")
                For Each c In .Range("A5", .Cells(Rows.Count, 1).End(xlUp))
            Set fn = Sheets("Completed").Range("A:A").Find(c.Value, , xlValues, xlWhole)
                If Not fn Is Nothing Then
                    adr = fn.Address
                    c.Interior.Color = RGB(161, 255, 127)
                    Do
'                        fn.Interior.Color = RGB(255, 100, 50)
                        Set fn = Sheets("Completed").Range("A:A").FindNext(fn)
                    Loop While fn.Address <> adr
                End If
        Next
    End With

How would I modify this code to do the folowing:
Compare sheet"Completed" Range(A:Q) to sheet "Import" Range(A:Q)
If all the cell values in this range match, then change the fill color on sheet "Import" Range (A:Q) instead of just column A"?

In other words, I want to compare Range(A:Q) instead of just column "A". If the whole row matches, then highlight Range(A:Q) instead of just column "A".

Thanks!

Chad
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,224,828
Messages
6,181,212
Members
453,023
Latest member
alabaz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top