简体   繁体   English

根据范围内的结果在Excel中更改单元格的值

[英]Changing the value of a cell in excel based on results in a range

I'm trying to automatize the result of a cell based on the color or data from a range. 我正在尝试根据颜色或范围内的数据自动生成单元格的结果。 Explanation: It will be a "OK" or "NOT OK" in a cell when there are red cells in a range or when there are some words there. 说明:当范围中有红色单元格或其中有一些单词时,单元格中将为“ OK”或“ NOT OK”。 Down is the image about an example of the table I want to work with. 下图是有关我要使用的表的示例的图像。

Example

I want to know if it is possible to do it only with formula or have to do it through VBA. 我想知道是否有可能仅使用公式来执行,还是必须通过VBA来执行。

If you need to use the color you will have to use vba, you can check the color of a cell with Cell.Interior.Color 如果需要使用颜色,则必须使用vba,可以使用Cell.Interior.Color检查单元格的颜色。

On a side note, if you do not want to use vba you could use the condition you use for your conditional formatting (Assigning the color to the cell) in the cell formula instead of using the color. 附带说明一下,如果您不想使用vba,则可以使用单元格公式中用于条件格式设置(将颜色分配给单元格)的条件,而不使用颜色。

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

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