EXCEL如何比对相似度
有没有办法将不一致的数据用红色表示出来(如第一第二行)或者区分出来呢?
求大神 展开
Private Sub CommandButton1_Click()
[A:B].Font.ColorIndex = xlAutomatic
Dim st$, sr$, i%, j%, r%, k%, m%
r = ActiveSheet.[A65536].End(3).Row
For i = 1 To r
m = Len(Cells(i, 1))
For k = 1 To m
If IsError(Application.Find(Mid(Cells(i, 1), k, 1), Cells(i, 2))) = True Then
Cells(i, 1).Characters(Start:=k, Length:=1).Font.Color = -16776961
End If
Next
Next
For i = 1 To r
m = Len(Cells(i, 2))
For k = 1 To m
If IsError(Application.Find(Mid(Cells(i, 2), k, 1), Cells(i, 1))) = True Then
Cells(i, 2).Characters(Start:=k, Length:=1).Font.Color = -16776961
End If
Next
Next
End Sub