Guest User

Untitled

a guest
Jun 23rd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2. If Range("A1").Value = "Car" Then
  3. Range("B1").Locked = False
  4. Else
  5. Range("B1").Locked = True
  6. End If
  7. End Sub
  8.  
  9. Private Sub Worksheet_Change(ByVal Target As Range)
  10. Dim rng As Range
  11.  
  12. Set rng = Intersect(Range("A1:A10"), Target)
  13. If rng Is Nothing Then
  14. ' Not updating the range we care about
  15. Exit Sub
  16. Else
  17. rng.Offset(0, 1).Locked = ... whatever ...
  18. End If
  19. End Sub
  20.  
  21. Private Sub Worksheet_Change(ByVal Target As Range)
  22.  
  23. If Range("A1").Value = "Car" Then
  24. Range("B1").Locked = False
  25. Me.Unprotect ("password")
  26. Else
  27. Range("B1").Locked = True
  28. Me.Protect ("password")
  29. End If
  30.  
  31. End Sub
Add Comment
Please, Sign In to add comment