LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default problem with protecting sheet

hello,

When selecting a sheet1 the sheet is protected.

Depending on the value (xx) in a cell on sheet2, I want sheet 1 to be
unprotected or stay protected.
I made a reference to the cell on sheet2: status

I created the following code but doesn't work.

Private Sub Worksheet_Activate ()
If Range(status) = "xx" Then
Activesheet.Unprotect Password:= "pass"
Else: Activesheet.Protect Password:= "pass"
End If
End Sub

How do I solve this?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
protecting formulas without protecting sheet so grouping still wor JM Excel Discussion (Misc queries) 1 June 4th 09 06:42 AM
automatic column sorting problem when protecting sheet Montana Excel Worksheet Functions 3 May 17th 07 09:55 AM
Protecting Sheet Nad Excel Programming 3 August 5th 06 06:30 PM
Protecting Worksheets Problem Andy Excel Programming 1 March 10th 06 08:40 PM
Protecting Sheet purplerayn Excel Worksheet Functions 1 October 21st 05 12:55 AM


All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"