PHPExcel two collors in one cell
php, phpexcel
Solution
Take a look at section 4.6.37 of the developer documentation describing rich text, and also the 05featuredemo.inc.php example in /Tests which demonstrates using rich text in a cell
$objRichText = new PHPExcel_RichText();
$run1 = $objRichText->createTextRun('RED ');
$run1->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_RED ) );
$run2 = $objRichText->createTextRun('BLUE ');
$run2->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_BLUE ) );
$objPHPExcel->setActiveSheetIndex(0)->setCellValue("A1", $objRichText);
Problem
I want to add more than one color to the cell on PHPExcel. Now I'm adding cell with this: ``` $objPHPExcel->setActiveSheetIndex(0)->setCellValue("A1", $text); ``` Found this, but doesn't work: ``` $RichText = new PHPExcel_RichText(); ``` Probably it something easy, just I didn't find.