|
使用宏1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Dim col As Integer
Dim dic As Object
col = Target.Column
Set dic = CreateObject("scripting.dictionary")
Columns(col).Interior.Color = xlNone
For i = 1 To Cells(65536, col).End(xlUp).Row
If dic.exists(Cells(i, col).Value) = False Then
dic(Cells(i, col).Value) = Cells(i, col).Address(0, 0)
Else
Range(dic(Cells(i, col).Value)).Interior.Color = vbYellow
Cells(i, col).Interior.Color = vbYellow
End If
Next
End Sub
| 这个是选中列自动高亮列中所有重复项
|
|