for my $row (0..$lastrow) { for my $i (0..$#swap) { $Sheet2->Range($swap[$i][1].$row)->{'Value'} = $Sheet1->Range($swap[$i][0].$row)->{'Value'}; } }