top of page

VBA code to delete specified rows on all worksheets


The below visual basic code, posted here, works well to delete the rows that you specify on all worksheets in a workbook. Simply enter the range of your rows on the line beginning 'Rows'.

Sub bleh()

Dim xWs As Worksheet

Set xWs = ActiveSheet

ThisWorkbook.Worksheets.Select

Rows("4:5").Select

Selection.Delete

xWs.Select

End Sub


bottom of page