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!
 
Sorry, I thought I could do this myself to edit it in the future, is it that complicated?
You can as it is not that complicated.


For example, I need Row 35, 93 and column C to remain hidden on Sheet 6.
Simply use the unhide code My Aswer Is This provide and then unhide the rows and column immediately before the ScreenUpdating=True code line.
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
'Here is what you need for you most recent request
'You should be able to see the way I did this and add more if you want
If you need more help just ask.

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
'Here is what you need for you most recent request
'You should be able to see the way I did this and add more if you want
Sheets(6).Range("C1:C1").EntireColumn.Hidden = True
Sheets(6).Range("R35:R35, R93:R93").EntireRow.Hidden = True
Application.ScreenUpdating = True
End Sub

If you want to hide Rows 35 to 45 and Rows 93 to 103 you would write the code like this:

Code:
Sheets(6).Range("R35:R45, R93:R103").EntireRow.Hidden = True
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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