我需要从 650 个数字的列表中搜索 105 个数字,如果找到则突出显示它们。有没有更简单的方法可以做到这一点?例如。exceel 中的 x 列有 10 个值,我需要在 x 列中搜索 5 个值并突出显示它。(当然实际数字更大)
答案1
如果你有简短的清单A以及列中的长列表乙喜欢:
运行此宏:
Sub dural()
Dim nA As Long, nB As Long, v As Variant
Dim a As Long, b As Long
nA = Cells(Rows.Count, "A").End(xlUp).Row
nB = Cells(Rows.Count, "B").End(xlUp).Row
For a = 1 To nA
v = Cells(a, "A").Value
For b = 1 To nB
If Cells(b, "B").Value = v Then
Cells(b, "B").Interior.ColorIndex = 6
End If
Next b
Next a
End Sub
将产生: