Clearing the cells

Topics: Developer Forum, User Forum
Oct 15, 2010 at 1:34 PM
Edited Oct 15, 2010 at 1:41 PM

Hi all,

      Is there any means available through which I can clear the cell?? Clearing in this context means removing the formatting.I searched the developer documentation as well as the discussions,but couldn't find any suitable result.

One more thing Is it possible in PHP Excel to read a particular sheet from a bunch of sheet. Like suppose I have a excel sheet with 10 sheets,So is it possible to read for example the 7th sheet??

Thanks

MaK

Coordinator
Oct 15, 2010 at 5:48 PM
Manash082 wrote:

Is there any means available through which I can clear the cell?? Clearing in this context means removing the formatting.I searched the developer documentation as well as the discussions,but couldn't find any suitable result.

Do you mean actually delete the cell? 

$objPHPExcel->getActiveSheet()->getCellCacheController()->deleteCacheData('B2')

should delete cell B2

Manash082 wrote:

One more thing Is it possible in PHP Excel to read a particular sheet from a bunch of sheet. Like suppose I have a excel sheet with 10 sheets,So is it possible to read for example the 7th sheet?? 

Set the active sheet to the 7th sheet using either:

$objPHPExcel->setActiveSheetIndex(6);

or

$objPHPExcel->setActiveSheetIndexByName('Sheet 7 Name');

if you know the sheet name.

Once you've set the active sheet, $objPHPExcel->getActiveSheet() will reference that sheet.