|
Sub 字体标红()
arow = ActiveSheet.Range("Q1").End(xlDown).Row
brow = ActiveSheet.Range("T1").End(xlDown).Row
For i = 2 To arow
For j = 2 To brow
bstr = Range("T" & j)
estr = Range("Q" & i)
pos = InStr(1, estr, bstr, 1)
If pos > 0 Then
Range("Q" & i).Select
With ActiveCell.Characters(Start:=pos, Length:=Len(bstr)).Font
.Color = -16776961
End With
End If
Next
Next
arow = ActiveSheet.Range("S1").End(xlDown).Row
brow = ActiveSheet.Range("T1").End(xlDown).Row
For a = 2 To arow
For b = 2 To brow
bstr = Range("T" & b)
estr = Range("S" & a)
pos = InStr(1, estr, bstr, 1)
If pos > 0 Then
Range("S" & a).Select
With ActiveCell.Characters(Start:=pos, Length:=Len(bstr)).Font
.Color = -16776961
End With
End If
Next
Next
End Sub
|
|