How to Select All sheets

D

Dawn Bjork Buzbee

Greetings All!

Simple I'm sure but not obvious:

Every month I generate a group of worksheets that will vary in name and
number.

What is the code to select all of the worksheets so that I can apply a
consistent page setup?

(The only examples I have been able to locate always specify worksheet names.)

Then, with the entire workbook selected, I want to select all cells to apply
consistent formatting.

Thanks in advance!
 
J

Jim Thomlinson

Try this...

Sub SelectAllSheets()
Dim wks As Worksheet

For Each wks In Worksheets
wks.Select False
Next wks
End Sub
 
D

Dawn Bjork Buzbee

Thanks Jim-I'll try it!
--
Dawn Bjork Buzbee


Jim Thomlinson said:
Try this...

Sub SelectAllSheets()
Dim wks As Worksheet

For Each wks In Worksheets
wks.Select False
Next wks
End Sub
 

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