Copy rows

Topics: Developer Forum, Project Management Forum, User Forum
Jul 21, 2009 at 3:35 PM

Hi,

I want to know if PHPExcel can copy rows or columns from a sheet to another or on the same sheet?

Thx

 

Developer
Jul 22, 2009 at 5:27 AM

>> I want to know if PHPExcel can copy rows or columns from a sheet to another
>> or on the same sheet?

Unfortunately not at the moment. You will have to do this manually (e.g. using loops in PHP).

I guess that such feature may one day be implemented, but we would need to implement cell range selection capabilities first. (There is already a feature request for this.) Once this is in place, we can perhaps think of copy/cut/paste.

Jan 25, 2011 at 8:39 PM

and with v1.7.5?

Coordinator
Jan 29, 2011 at 2:53 PM

Still no direct methods to copy a range of rows/columns, but this task can be simplified for copying cell values by using the rangeToArray() and fromArray() worksheet methods being introduced in 1.7.6. And I'll be looking at equivalent methods to read an array of style properties, and to write an array of style properties from a range of cells later in the year.

Oct 17, 2011 at 1:31 PM
Edited Oct 18, 2011 at 9:17 PM
koyama wrote:

Unfortunately not at the moment. You will have to do this manually (e.g. using loops in PHP).

Could you please post some example code how to copy rows (complete with values/formulas/styles/etc)?