欢迎来到我的地盘:今天是

若得山花插满头,莫问奴归处!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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

posted on 2011-11-19 15:51  莫问奴归处  阅读(1303)  评论(0编辑  收藏  举报
轩轩娃