Quick VBA code help

Hollywoood

Board Regular
Joined
Aug 11, 2011
Messages
53
Hi all,

Im looking to create a button that will make multiple sheets visible and select them all, so that I can then update the format of them easily (they are all the same template that occaisonally all need the same update)

Is there a way to select all sheets between two worksheets say Start:End, make them visible and select them?

Thanks for the help!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Give this a try:

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> UnHideSheets()<br><SPAN style="color:#007F00">'</SPAN><br><SPAN style="color:#007F00">' UnHideSheets Macro</SPAN><br><SPAN style="color:#007F00">'</SPAN><br><br><SPAN style="color:#007F00">'</SPAN><br>    Sheets(Array("Start", "End")).Select<br>    Sheets("End").Activate<br>    Sheets("Sheet2").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet3").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet4").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet5").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet6").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet7").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet8").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("End").Select<br>    Sheets("Sheet9").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets("<SPAN style="color:#00007F">End</SPAN>").Select<br>    Sheets("Sheet10").Visible = <SPAN style="color:#00007F">True</SPAN><br>    Sheets(Array("Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6", "Sheet7", "Sheet8", _<br>        "Sheet9", "Sheet10")).Select<br>    Sheets("Sheet2").Activate<br>End <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,351
Messages
6,178,061
Members
452,822
Latest member
MtC

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
Back
Top