Home Ask Login Register

Developers Planet

Your answer is one click away!

ManiMuthuPandi February 2016

Set cell background using column and row index

I am setting a cell value in phpexcel using below method setCellValueByColumnAndRow()


Now my requirment is to set background color for this.

I am not able to use this below method as I am aligned with rows and columns numbers.


I am searching a way to provide cols and rows as (2,3) not like ('A1:E1')

Please suggest an alternative way to set background color using column and row numbers.


Jimish Gamit February 2016

You cannot style a row in PHPExcel, only a cell or a range of cells



            'fill' => array(
                'type' => PHPExcel_Style_Fill::FILL_SOLID,
                'color' => array('rgb' => 'E05CC2')

Will set the background fill style for cells A1 to E1

Post Status

Asked in February 2016
Viewed 3,440 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life