Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compare two worksheets and Highlight duplicates in each
PLEASE HELP!
I am trying to highlight every row in a worksheet that has a duplicate in another worksheet in the same excel file. I have never programmed in excel but I am very skilled at VBA. I am using the following code. However, it errors out in the IF THEN statement. ***Unable to set the Pattern property of the interior class** I also tried using the ColorIndex property and I get the same error- Selection.Rows(counter).Interior.ColorIndex = vbYellow --------------- Sub Find_MatchesINZips() Dim compareRange As Variant Dim x As Variant, y As Variant Dim counter As Integer Set compareRange = Worksheets(2).Range("A2:A149") counter = 1 For Each x In Selection For Each y In compareRange If x = y Then Selection.Rows(counter).Interior.Pattern = vbYellow Next y counter = counter + 1 Next x End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
compare 5 columns of text and highlight duplicates based on repeti | Excel Worksheet Functions | |||
Compare & highlight changes between two worksheets? | Excel Worksheet Functions | |||
compare two columns within a worksheet, then highlight duplicates | Excel Worksheet Functions | |||
Compare Two Worksheets and Highlight Changes | Excel Programming | |||
Compare two worksheets and highlight the one sheet’s difference from the other one | Excel Programming |