Forum Discussion

Gregg1960's avatar
Gregg1960
Copper Contributor
Sep 30, 2023
Solved

Building a formula referencing Conditional Formatting colors

I'm trying to sum a column based on Conditional Formatting colors. In my worksheet, we use conditional formatting to change a cell's color to one of five shades of green based on its value. My partne...
  • HansVogelaar's avatar
    Sep 30, 2023

    Gregg1960 

    The Range object has a property DisplayFormat the represents the formatting as actually displayed on the screen, taking both direct formatting and conditional formatting into account.

    Unfortunately, DisplayFormat cannot be used directly in a VBA function in a cell formula - it causes an error. But it's possible by using a trick - see Using DisplayFormat in a UDF 

Resources