Password Protect Hidden Sheets With Macro

Mike Stephens

New Member
Joined
Sep 3, 2011
Messages
1
Hello all,

I'm new to the forum (been browsing a while, but never posted). I need to make a workbook with many sheets for different user groups. What I want to do is be able to have only one sheet show when opened. On this sheet I want to have a set of buttons to trigger different macros which unhide different sets of hidden sheets. For example; Sheet1 would contain three buttons. When you select button1 a password is required to unhide sheet2, sheet3, and sheet4. When you select button2 a different password is required to unhide sheet5, sheet6, and sheet7. When you select button 3 a different password is required to open sheet8, sheet9, and sheet10. It would also be nice for different users to be able to change their password if needed.

I've been using Excel for a while, but have very little experience with macros so I'm not even sure if this is possible. But I appreciate any advice.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
This may get you started

Code:
Private Sub CommandButton1_Click()
Dim pw As String, i As Long
pw = InputBox("Enter password")
If pw <> "VoG" Then Exit Sub
For i = 2 To 4
    Sheets(i).Visible = xlSheetVisible
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,762
Members
452,940
Latest member
rootytrip

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