简体   繁体   English

每行Excel条件格式

[英]Excel conditional Formatting per row

What I am trying to achieve is a conditional formatting of rows in a table looking for changes based on a backup of an older table. 我想要实现的是对表中的行进行条件格式化,以基于较旧表的备份来查找更改。

If there were any change to the table and it doesn't match the backup, then the row where the change was performed will change it's style. 如果表有任何更改,但与备份不匹配,则执行更改的行将更改其样式。

What I managed to do is to add a formula: 我设法做的是添加一个公式:

=IF(OR(B2<>'1LinkBU'!B2,C2<>'1LinkBU'!C2,D2<>'1LinkBU'!D2),1,0)

Checking if the rows are not equal to their counterparts on the backup table. 检查行是否与备份表上的行不相等。 If anything was changed in this row the formula cell gets a value of 1. And then in the conditional formatting I selected the second row and in the formula I said that if E2 = 1 then the formatting is valid. 如果在此行中进行了任何更改,则公式单元格的值将为1。然后在条件格式中,我选择了第二行,在公式中,我说如果E2 = 1则格式有效。

The thing is, this table supposed to grow a lot and be used by users who doesn't know how to use formulas as well as it really isn't convenient to enter a specific conditional formatting for each raw. 事实是,该表应该会大量增加,并且由不知道如何使用公式的用户使用,并且为每个原始数据输入特定的条件格式确实不方便。

Also, in the linked file I uploaded I recorded a macro that creates the row style I want but I don't know how to create a code that will use it. 另外,在我上传的链接文件中,我记录了一个宏,该宏可以创建所需的行样式,但是我不知道如何创建将使用该行样式的代码。

Is it possible to go through row2 down to what ever will be the last row and for each "1" value in the E column apply the Row style to the whole row? 是否可以遍历row2到最后一行,并且对于E列中的每个“ 1”值,将Row样式应用于整个行?

OK apparently I was just over thinking this! 好吧,显然我只是在想这个! It was actually very simple to do... all I had to do is change the formula from =$E$2=1 into =($E2=1) and apply the conditional formatting to the whole range of the table. 这实际上非常简单...我要做的就是将公式从= $ E $ 2 = 1更改为=($ E2 = 1)并将条件格式应用于表的整个范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM