Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

  1. Home >
  2. All Categories >
  3. Computers & Internet >
  4. Software >
  5. Resolved Question
sa29153 sa29153
Member since:
April 26, 2008
Total points:
63 (Level 1)

Resolved Question

Show me another »

Protect sheet using following vba code with "do not select locked cells"?

its not work when i open the work book then "do not select locked cell" is not work but when i enter the data on target cell then its work perfectly and some time the all vba code has not work.i use excel 2007.
Any can solve this?



Option Explicit

Private Sub WORKSHEET_CHANGE(ByVal TARGET As Range)
Dim wsSD As Worksheet
Dim wsS As Worksheet
Set wsSD = Sheets("DATA")
Set wsS = Sheets("STCC")
If TARGET.Address = "$L$171" Then
Sheets("STCC").Unprotect Password:="password"
wsS.Range("L172").Value = ""
wsSD.Range("Database").AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=wsS.Range("L170:L171"), _
CopyToRange:=wsS.Range("AC110"), Unique:=True
ActiveSheet.EnableSelection = xlUnlockedCells
Sheets("STCC").Protect DrawingObjects:=True, CONTENTS:=True, Scenarios:=True, Password:="password"

End If
End Sub
KALL by KALL
Member since:
September 22, 2007
Total points:
8,637 (Level 5)

Best Answer - Chosen by Voters

100% 1 Vote

There are currently no comments for this question.

Other Answers (0)

No other answers.

Answers International

Yahoo! does not evaluate or guarantee the accuracy of any Yahoo! Answers content. Click here for the Full Disclaimer.

Help us improve Yahoo! Answers. Send Feedback