password protecting

B4L4KS

Board Regular
Joined
Mar 7, 2011
Messages
69
hi

i know how to password protect a document and cells, but is there a way of password protecting a page so a user cant enter the page, not even look at the page without having to enter a password,

also can it be assigned to a hyper-link/ macro

many thanks

kristian
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
hi

i know how to password protect a document and cells, but is there a way of password protecting a page so a user cant enter the page, not even look at the page without having to enter a password,

also can it be assigned to a hyper-link/ macro

many thanks

kristian

You can make the Sheet very hidden (xlSheetVeryHidden) via the worksheet module Property window in the VBE. Then you can code the opening of the sheet to propmpt the user for a password.
 
Upvote 0
You need to create a userform with a command button and textbox on it, change the textbox properties "PasswordChar" for whatever you would like to see instead of the actual text, add this code to the commandbutton
Code:
Private Sub CommandButton1_Click()
If Me.TextBox1.Value <> "password" Then
Sheets("Sheet1").Select
End If
Unload Me
End Sub
add this code to the thisworkbook code module
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'check if it's the first sheet
If ActiveSheet.Name = "Sheet1" Then Exit Sub
'check system for your login name
If Environ("username") = "your username here" Then Exit Sub
UserForm1.Show
End Sub

It's just a quickly knocked up thing and there is much more you can do for multiple access....etc but it does mean that they must have macros enabled.
 
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

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