Hide And Password Protect A Sheet

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,196
Office Version
  1. 2010
Platform
  1. Windows
Can I hide and password protect a sheet? I have a form with a workbook as sheet 2. I would like to make this invisable to anyone without a password. Thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
With code

Code:
With Sheet2
    .Protect Password:="anything"
    .Visible = xlSheetVeryHidden
End With
 
Upvote 0
You can set the sheet to xlVeryHidden in VBA. That way it's not available in the standard menu of hidden sheets. You could add some code to prompt for a password with an Input Box and if the correct password is input, then show the sheet, else not.

HTH,

EDIT: Sorry Peter, didn't see you there. My internet connection is slooooow today.
 
Last edited:
Upvote 0
The sheet I want to protect is sheet 2, I did rename the tab. Do I put this code on sheet 1, or sheet 2. Then when I want to unhide sheet 2, ot will ask for a password? Is that how it works? Thanks

Code:
With Sheet2
    .Protect Password:="anything"
    .Visible = xlSheetVeryHidden
End With
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

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