I would like to remove the "button" in the the code below and have the code show up in Developer > Macros. I would rather type the range in VBA depending on what I need Ex. (A1:H10).


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


Private Sub CommandButton1_Click()
Highlight_Duplicates (Sheets("Sheet1").Range("C10:F14"))

End SubThanks.
H