Row range Copy & paste

Topics: User Forum
Feb 3, 2015 at 8:25 AM
Hello,
this text I have translated by Google, Sorry!

Now to the problem:
I want the contents of the row B2:AG2 copy and paste into line B14:AG14. The copy of the colors (duplicateStyle) works.
Is there a way how to (duplicateStyle) to copy the contents?
Greeting mario
[PHP]
//  Create new PHPExcel object
    $dateiname      = '00_demo_.xlsx';
    $objPHPExcel    = new PHPExcel();
    $objPHPExcel    = PHPExcel_IOFactory::load($dateiname);
    $fileTime       = filemtime($dateiname);
//-----------------------------------------------------------    
    $ActiveSheet    = $objPHPExcel->getActiveSheet();
    
//-----------------------------------------------------------    
//  Style von Zeile 2 in Zeile 14 duplizieren
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('B2'), 'B14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('C2'), 'C14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('D2'), 'D14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('E2'), 'E14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('F2'), 'F14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('G2'), 'G14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('H2'), 'H14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('I2'), 'I14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('J2'), 'J14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('K2'), 'K14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('L2'), 'L14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('M2'), 'M14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('N2'), 'N14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('O2'), 'O14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('P2'), 'P14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('Q2'), 'Q14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('R2'), 'R14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('S2'), 'S14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('T2'), 'T14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('U2'), 'U14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('V2'), 'V14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('W2'), 'W14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('X2'), 'X14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('Y2'), 'Y14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('Z2'), 'Z14');  
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('AA2'), 'AA14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('AB2'), 'AB14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('AC2'), 'AC14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('AD2'), 'AD14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('AF2'), 'AE14');
    $ActiveSheet->duplicateStyle($ActiveSheet->getStyle('AG2'), 'AG14');

[/PHP]
Feb 3, 2015 at 10:04 AM
Edited Feb 3, 2015 at 10:07 AM
I once tried something and it works. Is it that ok?
    $zeile = $objPHPExcel->getActiveSheet()->rangetoArray('B2:AG2');
                $objPHPExcel->getActiveSheet()->fromArray($zeile, null, 'B14');