foreach $tab_idx (1..3) { $wsheet_out = $wbook_out->Worksheets($tab_idx); $wsheet_out->{Name} = $tab_names[$tab_idx - 1]; $range->Copy(); #to preserve formulas and column widths my $range_out = $wsheet_out->Range($wsheet_out->Cells(1,1), $wsheet_out->Cells(1,1)); $range_out->PasteSpecial({Paste => $xlPasteFormulas}); $range_out->PasteSpecial({Paste => $xlPasteColumnWidths}); $wsheet_out->Paste();