Hide / Unhide Rows in protected sheets

rbkinkead

New Member
Joined
May 29, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,
I have a macro I use to protect all sheets within a workbook and it works well.
I want to enable users to unhide / hide hidden rows in the protected sheet.
This is what is used:

Sub ProtectAll()
Application.ScreenUpdating = False
Dim wSheet As Worksheet
Dim Pwd As String
Pwd = "######"
ActiveWorkbook.Protect Structure:=False
For Each wSheet In Worksheets
wSheet.Protect Password:=Pwd, _
DrawingObjects:=False, Contents:=True, Scenarios:=True, _
AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True
Next wSheet
End Sub

It still wont allow the users to unhide rows but will allow them to hide rows.
Any help will be greatly appreciated.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
There are a lot of options when it comes to protecting a worksheet. Before you code anything, you must find out if the worksheet can be protected in a way that allows what you want.

To find out, you should experiment by using various sheet protection options:

1680898264227.png


Once you find a combination that works THEN you can write VBA code to do it automatically.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

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