Protecting a worksheet display with a password

  • Thread starter Thread starter Prem
  • Start date Start date
P

Prem

Hi

I am able to protect a worksheet using feature in
Tools>Protection>Protect Worksheet. However this
protection is only on editing rights. I want to do the
same for display as well at the individual worksheet level.

Can some body provide me information on this
 
Prem, here is one way from ozgrid.com
http://www.ozgrid.com/News/LookUpPart2.htm

Private Sub Worksheet_Activate()
Dim strPassword As String
On Error Resume Next
Me.Protect Password:="Secret"
Me.Columns.Hidden = True

strPassword = InputBox("Password Please!", "OzGrid.com")

If strPassword = "" Then
Me.Previous.Select
Exit Sub
ElseIf strPassword <> "Secret" Then
MsgBox "Incorrect Password","OzGrid.com"
Me.Previous.Select
Exit Sub
Else
Me.Unprotect Password:="Secret"
Me.Columns.Hidden = False
End If

On Error GoTo 0
End Sub

Private Sub Worksheet_Deactivate()
On Error Resume Next
Me.Columns.Hidden = True
On Error GoTo 0
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **
 
OK... I'm wanting to prevent copying and pasting (which I assume is
editing)... but I seem to not be able to work... I may have come in mid
question/answer can some body tell me where to start to prevent somebody
from copying and pasting the info as well?

Thanks in advance for your help!

Greg
 
Back
Top