Hi Experts,
I am trying to highlight the duplicate values which is present in the column F which has the string values.
I am new to VBA scripting, I am trying to use below code but it is not working.
Can i also know how to select all the values in column F even though if there are some NULL values in between.
Could you kindly guide me where i am going wrong
Thanks,
Rameez Shaik
I am trying to highlight the duplicate values which is present in the column F which has the string values.
I am new to VBA scripting, I am trying to use below code but it is not working.
Can i also know how to select all the values in column F even though if there are some NULL values in between.
Could you kindly guide me where i am going wrong
Code:
Sub DuplicateValuesFromColumn()
Dim Cell As Range
Dim rng As Range
Set rng = Range("F2").End(xlDown)
rng.Select
For Each Cell In rng
If WorksheetFunction.CountIf(rng, Cell.Value) > 1 Then
Cell.Interior.ColorIndex = 6
End If
Next
End Sub
Thanks,
Rameez Shaik