|
楼主 |
发表于 2022-11-21 21:40
|
显示全部楼层
请教大侠,是以下这样的吗?
Sub 改变标识颜色()
For X = 3 To Cells(Rows.Count, 1).End(3).Row
Range("M3:M241").Select
ActiveWindow.ScrollRow = 1
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=" & """" & "合格期" & """" & "", Formula2:=""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).Font.Bold = 1
Selection.FormatConditions(1).Font.Italic = 0
Selection.FormatConditions(1).Font.Color = 5287936
Selection.FormatConditions(1).Font.TintAndShade = 0
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=" & """" & "已到期" & """" & "", Formula2:=""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).Font.Bold = 1
Selection.FormatConditions(1).Font.Italic = 0
Selection.FormatConditions(1).Font.Color = 65535
Selection.FormatConditions(1).Font.TintAndShade = 0
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:="=" & """" & "已超期" & """" & "", Formula2:=""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
Selection.FormatConditions(1).Font.Bold = 1
Selection.FormatConditions(1).Font.Italic = 0
Selection.FormatConditions(1).Font.Color = 255
Selection.FormatConditions(1).Font.TintAndShade = 0
Selection.FormatConditions(1).StopIfTrue = False
Next
End Sub |
|