Determining Conditional Formatting through VB

DougGGaff

New Member
Joined
Sep 6, 2006
Messages
1
I have a simple table that using conditional formatting to change the background color of cells based on value. This works.

I have a VB macro that exports this table into a Wiki syntax format for posting to a wiki page. I would like to detect the cell's background color and modify my macro to insert the appropriate Wiki markup.

CurrCell.Interior.Color and CurrCell.Interior.ColorIndex are returning a white background for cells that conditional formatting applies a different color to. These variables work fine if I've manually formatted the cell color.

Any ideas how to tell what conditional formatting did through VB?

Thanks, Doug
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Good evening DougGGaff

As you have found out, colours applied via conditional formatting aren't recognised as regular colours.

Chip Pearson has posted some useful custom functions on his pages for dealing with conditionally formatted cells :

http://www.cpearson.com/excel/CFColors.htm

HTH

DominicB
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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