I am having trouble when copying a row from one sheet to another in the same Excel file. Some cells contain large numbers, which creates a problem when copying them because they get rounded up and I don't want that to happen. I heard I can overcome that problem by pasting them as a string, as shown here. But no matter what I do the values of the cells are still formatted as numbers, which messes up the whole process.
Can you please help me? Thanks!
Excerpt code:
//por ultimo lo demas
for($i=2; $i<$rowCount;$i++){
$order = $objPHPExcel->getActiveSheet()->getCell('B'.$i)->getValue();
if($order != 'xxx'){
$cellValues = $objPHPExcel->getActiveSheet()->rangeToArray("A$i:AP$i", null, true, true, false);
$objPHPExcel->setActiveSheetIndex(1);
PHPExcel_Cell::setValueBinder(new PHPExcel_Cell_MyColumnValueBinder($cellValues));
$objPHPExcel->getActiveSheet()->fromArray($cellValues, null, 'A'.$newRow);
$newRow++;
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->setCellValue('B'.$i, 'xxx');
}
}