View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
EllenM EllenM is offline
external usenet poster
 
Posts: 78
Default Lock formula cells?

Hi Gary's Student,
Your script works beautifully. Looks like I need some work to protect
formulas cells by hand.

Thanks so much!!

Ellen

"Gary''s Student" wrote:

1. unprotect the sheet
2. unlock all cells
3. Edit Goto Special Formulae
4. Format Cells... Protection Locked
5. protect the sheet

To automate this, use this macro:

Sub Macro2()
ActiveSheet.Unprotect
Cells.Select
Selection.Locked = False
Selection.FormulaHidden = False
Selection.SpecialCells(xlCellTypeFormulas, 23).Select
Selection.Locked = True
ActiveSheet.Protect Contents:=True
ActiveSheet.EnableSelection = xlSelection

End Sub

--
Gary''s Student - gsnu200731


"EllenM" wrote:

Hello,
I'm designing a spreadsheet for my office. Is there a way to prevent my
folks from entering in data into cells with formulas?

Thanks in advance,
Ellen