Export (0) Print
Expand All
Expand Minimize

Range.Locked Property

Office 2007
Returns or sets a Variant value that indicates if the object is locked.

Syntax

expression.Locked

expression   A variable that represents a Range object.

Remarks

This property returns True if the object is locked, False if the object can be modified when the sheet is protected, or Null if the specified range contains both locked and unlocked cells.

Example

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

Visual Basic for Applications
Worksheets("Sheet1").Range("A1:G37").Locked = False
Worksheets("Sheet1").Protect



Community Additions

ADD
Show:
© 2015 Microsoft