Unhide Rows Not Functioning

thechad

Board Regular
Joined
Apr 28, 2014
Messages
117
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Greetings all,

I found the below code through Mr Excel. It was originally set up for unhiding columns but I modified it to do the same with rows. It was working when the worksheet itself was not protected, but when I add protection and enter the password ("ok") I receive a Run time error 1004...Unable to set Hidden property of the range class.

It obviously has something to do with the worksheet protection but I need to have it that way. How can I resolve this issue?

Thanks

Code:
  ShowPword = InputBox("Enter password to show hidden data")
  If ShowPword = "" Then Exit Sub
  If ShowPword <> "ok" Then MsgBox "Incorrect password...": Exit Sub  'Replace 'ok' with your real password
  Range("6:6, 8:8, 10:10, 12:12,14:14,16:16,18:18,20:20,22:22,24:24,26:26,28:28,30:30,32:32,34:34,36:36,38:38,40:40,42:42,44:44,46:46,48:48,50:50,52:52,54:54,56:56,58:58").EntireRow.Hidden = False
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Nevermind. I realized that it wasn't actually unlocking the sheet. I have integrated an unlock code and it works.
 
Upvote 0

Forum statistics

Threads
1,213,520
Messages
6,114,099
Members
448,548
Latest member
harryls

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