I know I can access a range of cells in order to format them:
$objPHPExcel->getActiveSheet()->getStyle('B3:B7')->getFill()
->setFillType(PHPExcel_Style_Fill::FILL_SOLID)
->getStartColor()->setARGB('FFFF0000');
Now is there a way, and if yes, how can I define multiple cells or a set of ranges within the getStyle()
call? I tried
$objPHPExcel->getActiveSheet()->getStyle('B3:B7;C6:C12')->getFill()->...
and
$objPHPExcel->getActiveSheet()->getStyle('B3;C9;D2;E6')->getFill()->...
but both didn't work and threw an error.
According to Mark Baker (Coordinator of the PHPOffice suite of Open Source libraries),
that doesn't work, [you can] only [define] one range at a time.
Source: Comments above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With