Sub Macro1()
'C列
Dim strC As String
'D列
Dim strD As String
'找出的行数
Dim intCount As Integer
intCount = 0
'外层循环
For i = 2 To 120
strC = "C" + Trim(Str(i))
For j = 2 To 800
strD = "D" + Trim(Str(j))
If Trim(Range(strC)) = Trim(Range(strD)) Then
intCount = intCount + 1
Range(strD).Select
With Selection.Font
.Name = "宋体"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.Color = red
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
Selection.Font.Italic = True
Exit For
End If
Next j
Next i
MsgBox intCount
End Sub