我使用了以下记录器宏:
Application.ScreenUpdating = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=0", Formula2:="=19.5"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = False
.Italic = True
.ColorIndex = 4
End With
Selection.FormatConditions(1).StopIfTrue = True
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="=19.6", Formula2:="=34.4"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = False
.Italic = True
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.499984740745262
End With
Selection.FormatConditions(1).StopIfTrue = False
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.FormatConditions(1).StopIfTrue = False
然后我使用宏来剪切所有条件,只保留格式。但是,无论我做什么,Isblank,添加另一个条件格式条件以仅在非空白上运行,在条件格式宏之后,格式为绿色(将任何 0-19.5 变为绿色,但单元格中没有任何内容)。
有没有办法给这个宏添加跳线?如果它是空白的,我希望它移动到下一个单元格。我没有设定范围,所以这就是全部选择的原因。