Advertisement
YasserKhalil2019

T3995_Allow Users To Edit Specific Range

Sep 25th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. https://excel-egy.com/forum/t3995
  2. ---------------------------------
  3.  
  4. Sub Allow_Users_To_Edit_Specific_Range()
  5. Dim ws As Worksheet, lr As Long
  6.  
  7. Set ws = ActiveSheet
  8.  
  9. With ws
  10. If .Range("A1") = "Yes" Then
  11. .Unprotect
  12. lr = .Cells(Rows.Count, 3).End(xlUp).Row
  13. .Cells.Locked = True
  14. .Range("A5:A" & lr).Locked = False
  15. .Protect
  16. End If
  17. End With
  18. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement