软件:ofice excel
版本:2010
是这样的,小弟弟我写了一段宏
希望能快速写入格式化规则
宏如下:
Sub testcolor()
Range("N6:T26").FormatConditions.Delete
Range("N6:T26").FormatConditions.Add Type:=xlExpression,
Formula1:="=($N6<>$Q6)*($Q6=$T6)"
Range("N6:T26").FormatConditions(1).Interior.Color = 13434879
Range("N6:T26").FormatConditions(1).StopIfTrue = False
End Sub
预期宏执行完毕之后,格式化的条件规则管理员应该会看到如下:
公式: =($N6<>$Q6)*($Q6=$T6)
套用到:=$N$6:$T$26