Conditional Style on multiple worksheets

Topics: Developer Forum, User Forum
Jan 23, 2013 at 12:18 PM

Hi,

I would like to know if the conditional style on the sceenshot is possible in phpexcel.

I have 2 tabs : Global and Interactions

Each row of column I of Interactions (rows 3 to 25) must be red if the corresponding cell value of Global is the same.

I tried this but it doesn't work :

$objConditional1 = new PHPExcel_Style_Conditional();
$objConditional1->setConditionType(PHPExcel_Style_Conditional::CONDITION_CELLIS);
$objConditional1->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_EQUAL);
$objConditional1->addCondition('Global!$F3');
$objConditional1->getStyle()->getFont()->getColor()->setARGB('FFFF0000');

$conditionalStyles = $sheet01->getStyle('I3:I'.$sheet01->getHighestRow())->getConditionalStyles();
array_push($conditionalStyles, $objConditional1);
$sheet01->getStyle('I3:I'.$sheet01->getHighestRow())->setConditionalStyles($conditionalStyles);

the result in MS Excel :

There is one condition by row and each row is compared to the same cell.

Is anyone can help me ?

Thanks by advance,
Devether