【问题标题】:excel 2007 how to automate conditional formattingexcel 2007 如何自动设置条件格式
【发布时间】:2011-09-02 15:43:03
【问题描述】:

我有很多单元格可以为条件格式分配一个公式。

我尝试录制宏以使其自动化,但未录制条件格式。是否有可能编写一些 VBA 来做到这一点?

【问题讨论】:

    标签: excel formatting conditional


    【解决方案1】:

    这对我有用:

    With Range("A1")
        .FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
            Formula1:="2", Formula2:="3"
        .FormatConditions(1).Interior.ColorIndex = 33
    End With
    

    即2 到 3 之间的值会将单元格着色为蓝色。

    【讨论】:

      猜你喜欢
      • 2013-12-24
      • 1970-01-01
      • 1970-01-01
      • 2011-06-16
      • 1970-01-01
      • 2010-11-03
      • 2013-06-03
      • 2013-10-04
      • 1970-01-01
      相关资源
      最近更新 更多