Advertisement
oshkoshbagoshh

lockcellswithformulas

Aug 18th, 2017
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '*******************************************************************************
  2. ' Locks all cells with formulas
  3. '
  4. '                           ~ AJ Javadi ~
  5. '*******************************************************************************
  6.  
  7.  
  8. Sub LockCellsWithFormulas()
  9.  
  10. With ActiveSheet
  11.  
  12.     .Unprotect
  13.    
  14.     .Cells.Locked = False
  15.    
  16.     .Cells.SpecialCells(xlCellTypeFormulas).Locked = True
  17.    
  18.     .Protect AllowDeletingRows:=True
  19.  
  20. End With
  21.  
  22. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement