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!
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

xtremegrump

New Member
Joined
Jan 7, 2011
Messages
45
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>
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,327
Members
414,053
Latest member
Dual Showman

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