VBA - Hide and protect different ranges with different passwords

offset

New Member
Joined
Oct 12, 2016
Messages
23
Hi all,

I have a protected sheet with different ranges that are hidden.

Is it possible write a code that unprotect only one of the hidden ranges? Then I want different passwords for all the ranges.

For example:

A workbook are sent to two different people with sensitive information.

Two ranges are hidden: Row 5-10 and row 15-20

Person 1 need to be able to unhide row 5-10 with a password, while still not able to unhide row 15-20 as it has another password.

Is that possible?

I know it might be easier to use multiple sheets and hide each sheet with it's own password, but however I would like it to be in the same sheet.

Thanks in advance.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Not using Excel's sheet protection.
What you can do is write your own passwordmanager for this purpose, and then when the one password is entered unprotect the sheet, unprotect the 1st hidden range, then protect the sheet again. And on saving the file do the reverse, so the file can only be saved fully protected. For the other hidden area you do the same linked to the other password.

Sounds easy, but lot of pitfalls. How are you going to store the passwords so they can't be cracked?


So your back-up plan is probably best. If the data is really sensitive, you should send the various people different copies of the workbook, where the information they are not entitled to is removed. Because cracking a workbook is not very difficult.
 
Upvote 0

Forum statistics

Threads
1,214,517
Messages
6,119,984
Members
448,935
Latest member
ijat

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