ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   unhide multiple worksheets in one go (https://www.excelbanter.com/excel-programming/380529-re-unhide-multiple-worksheets-one-go.html)

Paul B

unhide multiple worksheets in one go
 
srinivasan, this should do it,

Sub UnHide_All()
'unhide all sheets in a workbook
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
sht.Visible = xlSheetVisible
Next
End Sub




--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"srinivasan" wrote in message
...
Dear friends,
I am having a workbook with about 75 worksheets each named differently.
For
my convenience I hide many worksheets. Can I unhide all the hidden
worksheets
in one stroke with a macro or otherway?




JE McGimpsey

unhide multiple worksheets in one go
 
Note this will throw an error if you have any Chart sheets, since sht is
Dim'd as a Worksheet, but the For Each... objects are Sheets.



In article ,
"Paul B" wrote:

Sub UnHide_All()
'unhide all sheets in a workbook
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Sheets
sht.Visible = xlSheetVisible
Next
End Sub



All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com