Deleting rows from mutliple sheets

D

diba

Hello--could someone please tell me a more effecient way to loop
through each sheet (all are named) & delete the first 5 rows instead
of the following:

Sheets("cc1").Select
Range("a1:a5").EntireRow.Delete
Sheets("cc2").Select
Range("a1:a5").EntireRow.Delete
Sheets("cc3").Select
Range("a1:a5").EntireRow.Delete

Thanks in advance. Diba
 
G

Gord Dibben

Sub Deleting()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.Range("A1:A5").EntireRow.Delete
Next ws
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top