View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bobby[_4_] Bobby[_4_] is offline
external usenet poster
 
Posts: 53
Default Returned position address on protected sheet

On Tuesday, November 6, 2012 10:07:25 AM UTC-5, Bobby wrote:
I have a protected sheet with unprotected cells. If the user Click on a protected cell, the returned target is always the first unlock cell position or address. How can I verify that the target value is lock? Here is the code:



Private Sub Worksheet_SelectionChange(ByVal Target As Range)



If Not Intersect(Target, Range("E1:F" & lastrow)) Is Nothing Then

something.....

End If

End Sub



Thank's ahead

GS this is what I do:

Cells.Locked = True
ActiveSheet.Range("E1:F1").Select
Range("E1:F" & lastrow).Locked = False

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, UserInterfaceOnly:=True

ActiveSheet.EnableSelection = xlUnlockedCells

I am not sure that I understand your suggestion. Do I have to add something to my code?
Regards!