in reply to Re: excel conditional formatting
in thread excel conditional formatting

Thanks, Bart. That helped.I now get a conditional format, but the "=AND(J$i>0,K$i=0)" has been corrupted. With $i =11, I get "=AND(T21>0,U21=0)".

Replies are listed 'Best First'.
Re^3: excel conditional formatting
by ArtYaffe (Novice) on Sep 10, 2009 at 17:35 UTC
    Thanks, Bart, for your help. 'undef' in the second position is necessary. However, this method does something "relative", so I had to add dollar signs to the formula. Also, although I have 'use Win32::OLE::Const "Microsoft Excel";' in the code, xlYellow didn't work; I substituted '6'.
    $WS->Cells($i,11)->FormatConditions->Add (xlExpression,undef,"=AND(\$J\$$i>0,\$K\$$i=0)"); $WS->Cells($i,11)->FormatConditions(1)->Interior-> {ColorIndex} = 6; #xlYellow
    Problem solved. Thanks for everyone who chimed in.