How to unhide all rows and columns with a few exeptions?

Fabulist

Board Regular
Joined
Jan 28, 2014
Messages
110
Hello everyone,

How can I make this module:


Sub UnhideAll()
Columns.EntireColumn.Hidden = False
Rows.EntireRow.Hidden = False
End Sub

Work on all sheets and not only on the one I am viewing? Is there another way?

Also, is it possible to exempt specific columns & rows on specific sheets?

Thank you in advance!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try this

Code:
Sub UnhideAll()
for i=1 to worksheets.count 
     cells.select
     Columns.EntireColumn.Hidden = False
     Rows.EntireRow.Hidden = False
next i
End Sub
 
Upvote 0
Try this:
Code:
Sub Unhide_All()
Dim i As Long
Application.ScreenUpdating = False
    For i = 1 To Sheets.Count
        Sheets(i).Rows.Hidden = False
        Sheets(i).Columns.Hidden = False
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Paste the below code in this workbook

Code:
Sub worksheet_Open()
For i = 1 To Worksheets.Count
     Cells.Select
     Columns.EntireColumn.Hidden = False
     Rows.EntireRow.Hidden = False
Next i
End Sub
 
Upvote 0
Thank you both for your time, your code worked My Answer Is This, Application.ScreenUpdating is also a very useful command I did not know about, which is great to know.

Is there a way to add exclusions for specific rows / columns as well?
 
Upvote 0
You said:
"Is there a way to add exclusions for specific rows / columns as well?"

Anything is possible. What did you have in mind.
 
Upvote 0
Well I have some macros that hide multiple rows and columns. I would like that when I use your macro to unhide everything, some special rows and columns will remain hidden as specified. I have absolutely no idea what to do for this.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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