[英]How to identify/address Excel cell color when cells have been highlighted using conditional formatting?
I have an Excel sheet in which many cells have been highlighted using built-in conditional formatting commands.我有一个 Excel 工作表,其中使用内置条件格式命令突出显示了许多单元格。 If I try to change the cell color or fill by traditional means, I can neither change the non-filled cells to being filled, nor can I change the filled cells to being non-filled (the sheet is not locked, it's just that changing the color using these has no effect).如果我尝试通过传统方式更改单元格颜色或填充,我既不能将未填充的单元格更改为已填充,也不能将已填充的单元格更改为未填充(工作表未锁定,只是更改使用这些颜色没有效果)。 I can turn a filled cell "blank" by removing conditional formatting from the cell.我可以通过从单元格中删除条件格式来将填充的单元格变为“空白”。 Basically, I am trying to scan through the entire sheet and check each cell for whether or not it is colored, but I don't know the cell property to address for this particular case of formatting.基本上,我正在尝试扫描整个工作表并检查每个单元格是否有颜色,但我不知道要解决这种特殊格式情况的单元格属性。 I would greatly appreciate any help!我将不胜感激任何帮助! Thanks.谢谢。
To check for conditional formatting color you may have to use要检查条件格式颜色,您可能必须使用
Cells(x,y).DisplayFormat.Interior.Color
or .ColorIndex
Cells(x,y).DisplayFormat.Interior.Color
或.ColorIndex
to retrieve the color fill attribute as DisplayFormat
compensates for the conditional formatting.检索颜色填充属性,因为DisplayFormat
补偿了条件格式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.