Conditional formatin per column

Bejbas

New Member
Joined
Mar 20, 2019
Messages
6
Hello everyone,


I have got problem with conditional formatting.
In Column A and B a have got some values.
I'm looking for some way to hightlight duplicates values per columns. Of course I can create manually rules per column but finally file will be have over 1000 columns.
I need range where excel will be highlight duplicates.

For example:

Column AColumn B
grapesgrapes
mangococonut
melonpear
pineapplepeach
pear
grapes

<tbody>
</tbody>


Below screen:
https://imgur.com/4Vq9kKT


Thanks in advance.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hello,

You can use the following formula:

Code:
=COUNTIF(A2:A7,A2)>1

Hope this will help
 
Upvote 0
With all due respect but it doesn't work. Maybe I explain not enough cleary.
I recorded macro which highlight duplicates values but I have no idea what can I do to add range not one column.



Code:
Sub Macro4()'
' Macro4 Macro
'


'
    Columns("A:A").Select
    Selection.FormatConditions.AddUniqueValues
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    Selection.FormatConditions(1).DupeUnique = xlDuplicate
    With Selection.FormatConditions(1).Font
        .Color = -16383844
        .TintAndShade = 0
    End With
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 13551615
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    Columns("B:B").Select
    Selection.FormatConditions.AddUniqueValues
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    Selection.FormatConditions(1).DupeUnique = xlDuplicate
    With Selection.FormatConditions(1).Font
        .Color = -16383844
        .TintAndShade = 0
    End With
    With Selection.FormatConditions(1).Interior
        .PatternColorIndex = xlAutomatic
        .Color = 13551615
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
End Sub
 
Upvote 0
Hello,

Just tested formula on 10 Columns ... and it does work ... :wink:

We agree that after selecting you whole range from cell A2 to the very last cell of your sheet...

you add conditional formatting ... with this custom formula ...

HTH
 
Upvote 0
You are welcome ... :wink:

Pleased to hear everything is OK ...
 
Upvote 0

Forum statistics

Threads
1,215,432
Messages
6,124,858
Members
449,194
Latest member
HellScout

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