vb Help

  • Thread starter Stig - tame racing driver
  • Start date
S

Stig - tame racing driver

I have a password protect sheet, and all I'm after is a way to automatically
unlock the sheet when certain uses (admin) open it

I did have a go using this

If Environ = ("username") Then
ActiveSheet.Unprotect Password:="password"

Regards
 
G

Gary''s Student

Sub dural()
If Environ("username") = "ravenswood" Then
ActiveSheet.Unprotect
End If
End Sub

or some other specific username.
 
S

Stig - tame racing driver

Cheers

Gary''s Student said:
Sub dural()
If Environ("username") = "ravenswood" Then
ActiveSheet.Unprotect
End If
End Sub

or some other specific username.
 
G

Gord Dibben

Sheets cannot be "opened", only activated.

Private Sub Worksheet_Activate()
If Environ("username") = "Gord" Then
ActiveSheet.Unprotect Password:="password"
End If
End Sub


Gord Dibben MS Excel MVP
 
Top