Deleting rows from all sheets in an array?

G

Guest

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
 
R

Ron de Bruin

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
 

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