Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
worksheet protection
I found a macro in the archives! But I am having trouble
running it. I get the message "unable to set locked property of the range class". Where am I going wrong???? The debugger doesn't like the else: statement Thanks again, Todd Sub ProtFormula() Dim cell As Range Dim sht As Worksheet Application.ScreenUpdating = False For Each sht In Worksheets sht.Activate For Each cell In sht.UsedRange If cell.HasFormula = True Then cell.Locked = True cell.FormulaHidden = False Else: cell.Locked = False End If Next cell Next sht Application.ScreenUpdating = True End Sub -----Original Message----- Is there a way to select all cells without a formula and unlock them? Maybe a macro? I want to protect all the cells with formulas and leave the rest open to changes. Right now all cells with data are locked. I have a lot of worksheets so doing this manually will take a LONG time. TIA Todd . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Worksheet Protection | Excel Worksheet Functions | |||
Cell Protection vs. Worksheet Protection | Excel Discussion (Misc queries) | |||
Worksheet protection is gone and only wokbook protection can be se | Excel Discussion (Misc queries) | |||
Worksheet Protection | Excel Discussion (Misc queries) | |||
protection of worksheet | Excel Discussion (Misc queries) |