ProtectContents Property

Applies To

Chart Object, DialogSheet Object, Module Object, Worksheet Object.

Description

True if the contents of a sheet are protected. For a Visual Basic module, this protects the source code. For a chart, this protects the entire chart. For a dialog sheet, this protects the dialog layout and text of the dialog controls. For a worksheet, this protects the cells. Read-only.

See Also

Locked Property, Protect Method, ProtectWindows Property, Unprotect Method.

Example

This example displays a message box if the contents of Sheet1 are protected.


If Worksheets("Sheet1").ProtectContents = True Then
    MsgBox "The contents of Sheet1 are protected."
End If