Locking/Unlocking worksheet

amir9s

New Member
Joined
Jun 10, 2016
Messages
9
I'm pretty new to vba and not sure how complex what I need is.
I'm trying to create 2 clickable buttons on my sheet, one stating "Lock" and one "Unlock". When click on Lock, it asks for password and password confirmation to lock the file, and stores that password for when the file needs to be unlocked. and when click on Unlock button, it asks for password once and unlocks the file.

Locking the model would entail hiding some cells on the current worksheet and all other tabs.

I think this is not an easy one, so any tips, suggestion, recommendation... anything really helps. Thanks in advance!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Well amir, you can get there by recording macros (partially). Record a macro during the hiding of cells and locking the sheets. You'll need to create a form for asking what the password is. The same form could be used to lock or unlock the model. Then, of course, you'll need to create a couple buttons. Each of those tasks aren't hard. You'll probably need some help piecing together the code after you record the individual macros.

Jeff
 
Upvote 0

Forum statistics

Threads
1,215,730
Messages
6,126,528
Members
449,316
Latest member
sravya

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