简体   繁体   中英

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. 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

to retrieve the color fill attribute as DisplayFormat compensates for the conditional formatting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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