'###############################################################
'函数作用:在指定列中寻找含有指定字符串的单元格,并将符合条件的单元格标为红色,并将对应的下一列单元格赋值为 1。
'###############################################################
Sub AdvancedFilter()
For Each c In ActiveCell.CurrentRegion.Cells '挑选
If c Like "*新耗件入库*" Then '特定字符串
c.Font.Color = RGB(255, 0, 0)
End If
Next
For i = 1 To 10000 '将接下来一列相关条件符合的单元格赋值为 1
If Cells(i, 5).Font.Color = RGB(255, 0, 0) Then
Cells(i, 6) = 1
End If
Next
End Sub
联系客服