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

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
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
 

Forum statistics

Threads
1,137,293
Messages
5,680,651
Members
419,923
Latest member
Kalthus

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
Top