1

I am working on the phpexcel to create excel sheet and i have to validate that sheet for some columns. I tried for the below code

$objValidation = $objPHPExcel->getActiveSheet()->getCell('D1')->getDataValidation();

It gives me cell D1 validated but i want to validate whole column D validated.So what i have to do please help

varad mayee
  • 619
  • 7
  • 19

1 Answers1

-2
foreach($j=2; $j<=10; $j++) {
   $objPHPExcel->getActiveSheet()->getCell("D$j")->setDataValidation(clone $objValidation);
}

try this PHPExcel validate data for a range of cells

Community
  • 1
  • 1
Riddhi Rathod
  • 410
  • 2
  • 9