vba 如果一个单元格包含一个值,如何覆盖 excel 条件格式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25434687/
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
How do I override excel conditional formating if one cell contains a value
提问by Maggie Perea
I currently have a worksheet where column C changes to red if it is due in the next seven days. I would like to have the row change to a different format if I enter ANY date in column E. I have tried a bunch of different ways but I can only get the E cells to change or the entire worksheet and it seems to ignore the E entry.
我目前有一个工作表,如果 C 列在接下来的 7 天内到期,它会更改为红色。如果我在 E 列中输入任何日期,我希望将行更改为不同的格式。我尝试了多种不同的方法,但我只能更改 E 单元格或整个工作表,并且似乎忽略了 E入口。
Here is a link to the file: http://mpereaseportfolio.weebly.com/uploads/2/5/6/2/25627115/summer_assingment_schedule.xlsx
这是文件的链接:http: //mpereaseportfolio.weebly.com/uploads/2/5/6/2/25627115/summer_assingment_schedule.xlsx
回答by barry houdini
Try this:
尝试这个:
Select the whole range of data except headers, i.e. A2:H193
Now apply a new condition in conditional formatting using the formula
选择除标题外的整个数据范围,即A2:H193
现在使用公式在条件格式中应用新条件
=$E2<>""
=$E2<>""
Select required format
选择所需格式
Make sure that condition is at the top and tick "Stop if TRUE" so that other conditions are not applied
确保条件位于顶部并勾选“如果为真则停止”,以便不应用其他条件
Note that you need exactly that formula including the $
请注意,您完全需要该公式,包括 $
Note also that the formula always refers to the first row of data but will work for the whole range
另请注意,该公式始终指的是第一行数据,但适用于整个范围
回答by pnuts
Please try a formula rule such as:
请尝试公式规则,例如:
=(IFERROR(FIND(" AM",$E2),FIND(" PM",$E2))>0)
with applies to =$A$2:$H$200
or similar
与适用于=$A$2:$H$200
或类似