0

I have a text like Hello World in a cell. I want to change Color of the text World alone. I am using PHPExcel for creating excel.

I tried the below codes :

$objXls                 = new PHPExcel();
$objXls->getActiveSheet($sheetCount)->getStyle($cellCoordinates)->applyFromArray($styleArray);

The result of the above code is like whole text in the cell changed.

I tried PHPExcel_RichText also

       $objRichText = new PHPExcel_RichText();
       $objRichText->createText('World');
       $objPHPExcel->getActiveSheet()->getCell($cellCoordinates)->setValue($objRichText);

This also didn`t worked. Please help me to figure out the issue. Thanks

Aneesh Jose
  • 375
  • 6
  • 18
User09111993
  • 176
  • 2
  • 14

0 Answers0