ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   C# with Excel and conditional format (https://www.excelbanter.com/excel-programming/368754-c-excel-conditional-format.html)

ubsman

C# with Excel and conditional format
 

Neither of these 2 statements works. Both creates an Excel error. Any
ideas?

//
objRange.FormatConditions.Add(Excel.XlFormatCondit ionType.xlCellValue,Excel.XlFormatConditionOperato r.xlNotBetween,
//
"=WEEKDAY($A$2+VALUE(A$2)-1,1)=1","=WEEKDAY($A$2+VALUE(A$2)-1,1)=7").Interior.ColorIndex
= 10;
objRange.FormatConditions.Add(Excel.XlFormatCondit ionType.xlCellValue,Excel.XlFormatConditionOperato r.xlNotBetween,
"=1","=7").Interior.ColorIndex = 10;

Also, does anyone have a list of what these colorindex values are?


--
ubsman
------------------------------------------------------------------------
ubsman's Profile: http://www.excelforum.com/member.php...o&userid=36926
View this thread: http://www.excelforum.com/showthread...hreadid=566350



All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com