怎样使用VBA在已有条件格式区域增加条件
1、首先在开发工具中打开VBA编辑器
2、在单元格区域当中输入一些内容作为例子
3、在VBA编辑器中插入模块
4、在模块当中输入如下代码,然后运行Sub 新增一个条件格式() With Selection .FormatConditions.Add T烤恤鹇灭ype:=xlExpression, Formula1:="=OFFSET (A3,0,5)=""差""" .FormatConditions(.FormatConditions.Count).SetFirstPriority With .FormatConditions(1).Interior .PatternColorIndex=xlAutomatic .ColorIndex=3 .TintAndShade=0 End With End WithEnd Sub
5、使用快捷键Alt+F8调出运行宏窗口,然后单击“执行”按钮
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:41
阅读量:34
阅读量:87
阅读量:49
阅读量:46