条件格式 - 根据一列颜色整个行 [英] Conditional Formatting - Color Scale entire row based on one column

查看:222
本文介绍了条件格式 - 根据一列颜色整个行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想根据列中的值(在条件格式菜单中使用excel 内置颜色比例选项)对完整的行进行颜色调整。我该如何实现?请参阅以下图片

解决方案

Range.DisplayFormat.Interior.Color 在这个 post 。使用这个属性,我可以获得有条件格式化单元格的颜色,并将其用于其他行。 Catch是,它的工作原理仅在2010年以后才起作用。我有excel 2010,所以它为我工作。
这是确切的代码 -

 对于i = rowStart到rowEnd 
对于j = columnStart到columnEnd
单元格(i,j).Interior.Color =单元格(i,4).DisplayFormat.Interior.Color
下一个
下一个
pre>

Suppose I want to color scale complete rows on the basis of values in a column (using excel inbuilt color scale option in the conditional formatting menu). How do I achieve this? Please see the following image

解决方案

I found a property Range.DisplayFormat.Interior.Color in this post, at Mrexcel. Using this property I was able to get color of conditionally format cell and use it for the other rows. Catch is, it works only excel 2010 onwards. I have excel 2010 so it worked for me. Here is the exact code -

For i = rowStart To rowEnd
    For j = columnStart To columnEnd
        Cells(i, j).Interior.Color = Cells(i, 4).DisplayFormat.Interior.Color
    Next
Next

这篇关于条件格式 - 根据一列颜色整个行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆