VB宏基本案例(9)

Sub checkMenu()

    Sheets("all").Select
    Dim codeStr As String
    For j = 1 To 1000
        codeStr = Range("d" & j).Value
        Columns("D:D").Select
        Set fin_cha = Selection.Cells.Find(What:=codeStr, LookIn:=xlValues, LookAt:= _
        xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False)
       
        Set fin_cha = Selection.Cells.FindNext(After:=fin_cha)
       
        If Not fin_cha Is Nothing Then
       
        Else
            Range("c" & j).Value = ".................."
        End If
    Next j
End Sub

posted @ 2012-12-11 16:26  陳さん様  阅读(111)  评论(0)    收藏  举报