Select All worksheets in a workbook

MrSnow

New Member
Joined
May 6, 2005
Messages
14
Guys,

This is probably a really simple bit of code, and i'm pulling my hair out!!

I want to select every worksheet in a work book (approx 15) so that I can then carry out some standard formatting.

What I need to know is how to select the worksheets in the first place!!

Any suggestions?? All help is greatly appreciated!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

MrSnow

New Member
Joined
May 6, 2005
Messages
14
Thanks Steve,

But what if the size of the workbook increases at somepoint in the future (hypothetically) - the code would then need to be re-written. Is there a way of coding a generic "select all"???

Cheers
 

DominicB

Well-known Member
Joined
Oct 3, 2005
Messages
1,569
Good afternoon MrSnow

Via code? Try this :

Code:
Sub test()
Worksheets.Select
End Sub

HTH

DominicB
 

MrSnow

New Member
Joined
May 6, 2005
Messages
14
lol, so simple i'm almost embarrassed....

Thank you very much Dom
 

Forum statistics

Threads
1,141,757
Messages
5,708,340
Members
421,566
Latest member
7Nabisco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top