[英]VBA Color Cells Depending on the value
I would like to color cells depending on their value.我想根据它们的值对单元格进行着色。 If the value is 0, the cell should be green, if 1 then red.
如果值为 0,则单元格应为绿色,如果为 1,则为红色。 The whole thing should be a progression so the closer the value is to 1 the redder the cell should be.
整个事情应该是一个进步,所以值越接近 1,单元格应该越红。
Is there a suitable function for this?有合适的 function 吗?
Many thanks:)非常感谢:)
My current solution looks like that but its not very pretty;)我目前的解决方案看起来像这样,但不是很漂亮;)
Cells(i, 20) = (l / j) * 1
Cells(i, 20).Interior.Color = RGB(255 * (l / j), 255 * (1 - (l / j)), 0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.