PC Review


Reply
Thread Tools Rate Thread

Deleting rows from mutliple sheets

 
 
diba
Guest
Posts: n/a
 
      16th Aug 2007
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

 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      16th Aug 2007
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

On Thu, 16 Aug 2007 09:26:16 -0700, diba <(E-Mail Removed)> wrote:

>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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct across mutliple sheets - deleting row in one sheet StephenT Microsoft Excel Misc 2 17th Mar 2010 08:59 AM
Deleting all rows in all sheets Jodie Microsoft Excel Programming 4 9th Nov 2009 05:18 PM
Deleting rows from all sheets in an array? =?Utf-8?B?QVZS?= Microsoft Excel Programming 1 31st Jan 2007 04:26 PM
deleting mutliple rows in different ranges at same time =?Utf-8?B?SGVhdGhlck8=?= Microsoft Excel Programming 4 14th Feb 2005 02:01 PM
Deleting rows in a workbook though all coresponding sheets =?Utf-8?B?RGF2ZSBCYXRlcw==?= Microsoft Excel Misc 2 8th Feb 2004 10:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 PM.