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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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,224,521
Messages
6,179,277
Members
452,902
Latest member
Knuddeluff

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