以下的宏代码,其功能是,找到AB两列相同值,并存放到C列。
Sub MySubSearch()
Dim i As Integer
Dim c As Range
For i = 2 To Sheet1.[B65536].End(xlUp).Row
For Each c In Sheet1.Range("A2:A" & Sheet1.[A65536].End(xlUp).Row)
If Cells(i, 2).Value = c Then Cells(i, 2).Font.ColorIndex = 3
Next c
If Cells(i, 2).Font.Colo...[ 查看全文 ]