public function removeCellXfByIndex($pIndex = 0)
    {
        if ($pIndex > count($this->_cellXfCollection) - 1) {
            throw new PHPExcel_Exception("CellXf index is out of bounds.");
        } else {
            // first remove the cellXf
            array_splice($this->_cellXfCollection, $pIndex, 1);

            // then update cellXf indexes for cells
            foreach ($this->_workSheetCollection as $worksheet) {
                foreach ($worksheet->getCellCollection(false) as $cellID) {
                    $cell = $worksheet->getCell($cellID);
                    $xfIndex = $cell->getXfIndex();
                    if ($xfIndex > $pIndex ) {
                        // decrease xf index by 1
                        $cell->setXfIndex($xfIndex - 1);
                    } else if ($xfIndex == $pIndex) {
                        // set to default xf index 0
                        $cell->setXfIndex(0);
                    }
                }
            }
        }
    }
public function removeCellXfByIndex($pIndex = 0)
    {
        if ($pIndex > count($this->_cellXfCollection) - 1) {
            throw new PHPExcel_Exception("CellXf index is out of bounds.");
        } else {
            // first remove the cellXf
            array_splice($this->_cellXfCollection, $pIndex, 1);

            // then update cellXf indexes for cells
            foreach ($this->_workSheetCollection as $worksheet) {
                foreach ($worksheet->getCellCollection(false) as $cellID) {
                    $cell = $worksheet->getCell($cellID);
                    $xfIndex = $cell->getXfIndex();
                    if ($xfIndex > $pIndex ) {
                        // decrease xf index by 1
                        $cell->setXfIndex($xfIndex - 1);
                    } else if ($xfIndex == $pIndex) {
                        // set to default xf index 0
                        $cell->setXfIndex(0);
                    }
                }
            }
        }
    }
public function removeCellXfByIndex ( $ pIndex = 0 ) { if ( $ pIndex > count ( $ this -> _cellXfCollection ) - 1 ) { throw new PHPExcel_Exception ( "CellXf index is out of bounds." ) ; } else { // first remove the cellXf array_splice ( $ this -> _cellXfCollection , $ pIndex , 1 ) ; // then update cellXf indexes for cells foreach ( $ this -> _workSheetCollection as $ worksheet ) { foreach ( $ worksheet -> getCellCollection ( false ) as $ cellID ) { $ cell = $ worksheet -> getCell ( $ cellID ) ; $ xfIndex = $ cell -> getXfIndex ( ) ; if ( $ xfIndex > $ pIndex ) { // decrease xf index by 1 $ cell -> setXfIndex ( $ xfIndex - 1 ) ; } else if ( $ xfIndex == $ pIndex ) { // set to default xf index 0 $ cell -> setXfIndex ( 0 ) ; } } } } }
Remove cellXf by index. It is ensured that all cells get their xf index updated.

@param  int $pIndex Index to cellXf
@throws PHPExcel_Exception
Remove cellXf by index . It is ensured that all cells get their xf index updated .