Detect fill colour in cells

davej311

New Member
Joined
Nov 17, 2012
Messages
37
I have a conditional formatting that shades cells based on my criteria, however if the cell already as shading I want to leave it as is. How can I do this please?

Thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
How is it "already have shading"
If manual shading then you have to use VBA to detect the colour of the cell, you would not be able to do this via Condtional Formatting.
If you're saying the cell is shaded by an existing Condtional Formatting then just use the same condition to detect if the cell is already shaded in your new CF formula.
 
Upvote 0
I'm not an expert on VBA and certainly haven't delved into the "detecting colours" side of VBA :(
 
Upvote 0
One option.
In Name manager create a name, I've used IsColoured, & in the refers to box put =GET.CELL(63,INDIRECT("rc",FALSE))
Then in you Conditional formatting formula you can use something like
=AND(A1<>"",IsColoured=0)

The workbook will need to be saved as Macro enabled.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top