Forum Discussion
Building a formula referencing Conditional Formatting colors
- Sep 30, 2023
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
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
- Gregg1960Sep 30, 2023Copper ContributorYes, that works! Thank you very much.
- NiketanJan 12, 2025Copper Contributor
Hi Gregg1960 ,
Can you please share excel sheet with this applied VBA example?
That'll be so helpful. Thanks in advance!!
Actually I'm trying to sum of conditionally formatted color (green & yellow) cells values.
- HansVogelaarJan 13, 2025MVP
See the attached workbook.