Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
                                      $sht->Cells(2, 2)->{Value} = 'b';
    $sht->Cells(3, 1)->{Value} = 'c'; $sht->Cells(3, 2)->{Value} = 'c';
    $sht->Cells(1, 2)->Delete({Shift=>xlUp});
    
  2. or download this
    use strict;
    use warnings;
    ...
                                      $sht->Cells(2, 2)->{Value} = 'b';
    $sht->Cells(3, 1)->{Value} = 'c'; $sht->Cells(3, 2)->{Value} = 'c';
    $sht->Cells(1, 2)->EntireRow->Delete;
    
  3. or download this
    use strict;
    use warnings;
    ...
        my $cell = $sht->Cells($count, 2);
        if (!defined $cell->{Value}) { $cell->EntireRow->Delete; } 
    }
    
  4. or download this
    use strict;
    use warnings;
    ...
        my $cell = $sht->Cells($count, 2);
        if (!defined $cell->{Value}) {$cell->EntireRow->Delete} 
    }
    
  5. or download this
    use strict;
    use warnings;
    ...
    $xl->{SheetsInNewWorkbook} = $nShtsOld;
    
    $wb->Sheets(1)->Delete;
    
  6. or download this
    use strict;
    use warnings;
    ...
    for my $nSht(2..3) {
        $wb->Sheets($nSht)->Delete;
    }
    
  7. or download this
    use strict;
    use warnings;
    ...
    for (my $nSht = 3; 1 < $nSht; $nSht--) {
        $wb->Sheets($nSht)->Delete;
    }
    
  8. or download this
    use strict;
    use warnings;
    ...
    for my $nSht (2..$wb->Sheets->{Count}) {
        $wb->Sheets(2)->Delete;
    }