Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

New Post: Conditional Formatting: Color Row

$
0
0
I finally found a solution.
The example for "Using Formulas" induced me to error.

If I use .WhenEquals() doesn't work, I have to use .WhenIsTrue()

Here is how I color a row from A to N depending on the value of M column:
ws.Range("A1:N100").AddConditionalFormat().WhenIsTrue("=$M1=\"Hello\"").Fill.SetBackgroundColor(XLColor.Gray);
And here is how it is shown on Excel:
Image

It works correctly.
Thanks.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>