View Single Post
  #5   Report Post  
Pank Mehta
 
Posts: n/a
Default

Thanks to Peter and Michael for you help.

"Michael Bednarek" wrote:

On Wed, 30 Mar 2005 00:31:03 -0800, "Pank Mehta"
wrote in microsoft.public.excel.misc:

I have a macro that selects all worksheets in a book and undertakes
formatting for them.

Is there a way that I can specify in the loop to select all sheets bar a
specific one, which is called MAIN?

If not then I intend to delete the sheet during the execution of a macro,
but I need to get the macro to delete it without giving the user the option
to confirm the delete (i.e. by pass the delete confirmation message).


Maybe I'm missing something, but doesn't this do what you want?

Dim mySheet As Worksheet

For Each mySheet In Worksheets
If mySheet.Name < "MAIN" Then
' Do your formatting
End If
Next mySheet

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"