Locked Property [Excel 2003 VBA Language Reference]

Locked property as it applies to the ChartObject, ChartObjects, LinkFormat, OLEObject, OLEObjects, Scenario, Shape, and Style objects.

True if the object is locked, False if the object can be modified when the sheet is protected. Read/write Boolean.

expression.Locked

expression Required. An expression that returns one of the above objects.

Locked property as it applies to the CellFormat and Range objects.

True if the object is locked, False if the object can be modified when the sheet is protected. Returns Null if the specified range contains both locked and unlocked cells. Read/write Variant.

expression.Locked

expression Required. An expression that returns one of the above objects.

Example

As it applies to the CellFormat and Range objects.

This example unlocks cells A1:G37 on Sheet1 so that they can be modified when the sheet is protected.

Worksheets("Sheet1").Range("A1:G37").Locked = False
Worksheets("Sheet1").Protect

Applies to | CellFormat Object | ChartObject Object | ChartObjects Collection Object | LinkFormat Object | OLEObject Object | OLEObjects Collection Object | Range Collection | Scenario Object | Shape Object | Style Object

See Also | FormulaHidden Property | Protect Method | Unprotect Method