Reputation: 23
I have an excel file with around 300 sheets for which I need to remove the first rows. Could you please suggest VBA code for doing this?
Thanks in advance!
Upvotes: 0
Views: 19661
Reputation: 2438
Private Sub deleteRows()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Sheets
ws.Range("A1").EntireRow.Delete
Next ws
End Sub
Upvotes: 1
Reputation: 1520
Atleast try to post what you have tried.
below code will delete 1st in all sheets in active workbook
Sub LoopThroughSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Range("1:1").Delete
Next ws
End Sub
Upvotes: 6