Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AVR AVR is offline
external usenet poster
 
Posts: 14
Default Deleting rows from all sheets in an array?

I am trying to delete the same specified rows from a each sheet within a
collection of sheets in a workbook. Using code analogous to the following,
I'm getting a error.
If this is incorrect, is there a way to do it without actually "selecting"
the different sheets?

Sheets(Array("A", "B","C","D","E","F") ).Rows("5:10").Delete

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting rows from all sheets in an array?

Hi AVR

Try this

Dim sh As Worksheet
For Each sh In Sheets(Array("A", "B", "C", "D", "E", "F"))
sh.Rows("5:10").Delete
Next sh


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"AVR" wrote in message ...
I am trying to delete the same specified rows from a each sheet within a
collection of sheets in a workbook. Using code analogous to the following,
I'm getting a error.
If this is incorrect, is there a way to do it without actually "selecting"
the different sheets?

Sheets(Array("A", "B","C","D","E","F") ).Rows("5:10").Delete

Thanks

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
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Deleting rows, cuts and pastes affected tabbed sheets John G.[_2_] Excel Discussion (Misc queries) 4 June 28th 08 01:08 AM
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
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM
Updating, Deleting and inserting rows over two Excel Sheets Dilip Mistry Excel Worksheet Functions 0 July 25th 05 07:09 PM


All times are GMT +1. The time now is 10:30 AM.

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

About Us

"It's about Microsoft Excel"