Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Deleting rows from mutliple sheets

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Deleting rows from mutliple sheets

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 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct across mutliple sheets - deleting row in one sheet StephenT Excel Discussion (Misc queries) 2 March 17th 10 08:59 AM
MATCH() or VLOOKUP() across mutliple 65K sheets possible? [email protected] Excel Discussion (Misc queries) 4 July 25th 08 05:06 AM
Deleting rows from all sheets in an array? AVR Excel Programming 1 January 31st 07 04:26 PM
inserting deleting rows?how do i get the other sheets to do the sa cunningham82 Excel Discussion (Misc queries) 0 December 27th 06 09:51 PM
deleting mutliple rows in different ranges at same time HeatherO Excel Programming 4 February 14th 05 02:01 PM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"