vba 检查是否应用了条件格式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17121987/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Check whether Conditional Formatting is applied or not
提问by Tejas
Using Excel VBA Code is there any way by which I can check whether a particular cell has satisfied Conditional Formatting or not?
使用 Excel VBA 代码有什么方法可以检查特定单元格是否满足条件格式?
I have data in a single column with than 80000 cells.
我在单列中有超过 80000 个单元格的数据。
I used the following code but it gives same value for Interior.ColorIndex or Interior.PatternIndex or Font.Bold irrespective of whether the Coditional Formatting is applied or not
我使用了以下代码,但它为 Interior.ColorIndex 或 Interior.PatternIndex 或 Font.Bold 提供了相同的值,而不管是否应用了编码格式
Sub Check_CF()
MsgBox Range("B4").Interior.PatternColorIndex
End Sub
My conditional formatting rule is not important. I can change the rule if I am able to check whether it is applied or not.
我的条件格式规则并不重要。如果我能够检查它是否被应用,我可以更改规则。
Please help. Thanks in Advance.
请帮忙。提前致谢。
回答by Sandman
Found this rather long article with example functions on the subject that might be of help to you: http://www.xldynamic.com/source/xld.CFConditions.html
找到这篇相当长的文章,其中包含可能对您有帮助的主题的示例函数:http: //www.xldynamic.com/source/xld.CFConditions.html