Format Text with leading apostrophe

Topics: Developer Forum, User Forum
Jun 19, 2013 at 7:45 PM
Need to format the header row of my file to be formatted as that when you view the cell in the Excel spreadsheet it shows as HEADER but when you click that cell in the formula bar it shows 'HEADER.

I've tried seemingly just about everything with no luck. Whatever i try displays it in the cell as 'HEADER. However if I double click that cell in Excel it autoformats the way I want and strips the apostrophe out of the cell and leaves it in the formula bar.
And excel does that as well in a new cell where I type 'WHATEVER it will just display WHATEVER in the cell and still display 'WHATEVER in the formula bar.

How can I do this so it's already displayed that way when I create my Excel file with phpExcel?

This is how I'm inserting the values right now.

$objPHPExcel->getActiveSheet()->setCellValueExplicit($currentColumn.$currentRow, $data, PHPExcel_Cell_DataType::TYPE_STRING);

$data would just be a string preceded by an apostrophe.
Coordinator
Jun 25, 2013 at 3:24 PM
Please see answer on StackOverflow