我有一个原始数据,其中包含表格格式的数据。如果任何单元格值包含文本“紧急”(该文本可以出现在单元格中的任何位置),则需要突出显示连续的6行。
我写了一个代码,但是对我没有效果。在这里,我使用“ J”列进行硬编码。但是,我的字符串可以出现在任何列中。
With Cells
.FormatConditions.Add Type:=xlExpression,Formula1:= _
"=IsnUMber(SEARCH(""Urgent*"",$J1))"
With .FormatConditions(.FormatConditions.Count)
.setfirstPriority
With .Interior
.PatternColorIndex = xlAutomatic
.Color = 7405514
.TintAndShade = 0
End With
StopIfTrue = False
End With
![excel] https://ibb.co/swkBbtY