|
- Sub 对比3()
- Dim ss As Range
- Dim ss1 As Range
- Set reg = CreateObject("vbscript.regexp")
- Set reg1 = CreateObject("vbscript.regexp")
- pat = "[^、]+"
- With reg
- .Global = True
- .Pattern = pat ' "[一-龢]+"
- For Each ss In Range("b2", Cells(Rows.Count, 2).End(xlUp))
- Set sj = .Execute(ss)
- For Each xm In sj
- If Not "、" & ss.Offset(0, -1) & "、" Like "*、" & xm & "、*" Then
- qd = xm.firstindex + 1
- cd = xm.Length
- ss.Characters(qd, cd).Font.Color = 255
- End If
- Next xm
- Next ss
- End With
- With reg1
- .Global = True
- .Pattern = pat ' "[一-龢]+"
- For Each ss1 In Range("a2", Cells(Rows.Count, 1).End(xlUp))
- Set sj1 = .Execute(ss1)
- For Each xm1 In sj1
- If Not "、" & ss1.Offset(0, 1) & "、" Like "*、" & xm1 & "、*" Then
- qd1 = xm1.firstindex + 1
- cd1 = xm1.Length
- ss1.Characters(qd1, cd1).Font.Color = 255
- End If
- Next xm1
- Next ss1
- End With
- End Sub
复制代码 |
|