Excel更改单元格颜色 [英] Excel change cell color

查看:80
本文介绍了Excel更改单元格颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是确认这不是条件格式!我正在使用Excel 2010.

Just to confirm that this is NOT JUST conditional formatting! I'm using Excel 2010.

我使用了 http://www.cpearson.com/excel/colors.aspx ColorIndexOfOneCell函数,但是它似乎无法识别条件格式化的单元格颜色.使用了以下代码,并在C89中使用了相关的单元格颜色:

I have used http://www.cpearson.com/excel/colors.aspx ColorIndexOfOneCell function, but it doesnt seem to identify the Conditionally Formatted cell colors. The following code has been used, with the relevant cell color in C89:

=SUMPRODUCT(--(colorindex(L6:L82)=ColorIndexOfOneCell($C$89,FALSE,1)))

有什么想法吗?

PS.手动更改单元格颜色时(在条件格式的后面"),ColorIndexOfCell会选择它.

PS. When manually changing the cell colors ("behind" the conditional formatting), ColorIndexOfCell DOES pick it up.

推荐答案

谷歌搜索"excel条件格式的颜色已应用vba"产生链接:

Googling "excel conditional formatting color applied vba" yields a link: http://www.cpearson.com/excel/cfcolors.htm (heay same source). It suggests checking with their ActiveCondition script.

或者:"vba excel check active condition"在此页面上显示备用代码:

Or alternatively: "vba excel check active condition" yields an alternative code on this page:

两者都归结为循环遍历可能的 FormatConditions ,然后检查脚本是否满足条件.满足条件时,将采用该条件的颜色.

Both come down to looping through possible FormatConditions and then checking in the script if the condition is met. When the condition is met the color of that condition is taken.

这篇关于Excel更改单元格颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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