lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I would appreciate if you can help me understand the code below
1) What does Dim Cell mean? why "as" was omitted
2) What does ">" do here?
3) Is these easier implementation of similar code? Thank you.
https://www.automateexcel.com/vba/highlight-duplicates-in-range/
I would appreciate if you can help me understand the code below
1) What does Dim Cell mean? why "as" was omitted
2) What does ">" do here?
3) Is these easier implementation of similar code? Thank you.
Code:
Sub Highlight_Duplicates(Values As Range)
Dim Cell
For Each Cell In Values
If WorksheetFunction.CountIf(Values, Cell.Value) > 1 Then
Cell.Interior.ColorIndex = 6
End If
Next Cell
End Sub
https://www.automateexcel.com/vba/highlight-duplicates-in-range/