Protection.AllowFormattingCells property (Excel)

Returns True if the formatting of cells is allowed on a protected worksheet. Read-only Boolean.

Syntax

expression.AllowFormattingCells

expression A variable that represents a Protection object.

Remarks

The AllowFormattingCells property can be set by using the Protect method arguments.

Use of this property disables the protection tab, allowing the user to change all formats, but not to unlock or unhide ranges.

Example

This example allows the user to format cells on the protected worksheet and notifies the user.

Sub ProtectionOptions() 
 
 ActiveSheet.Unprotect 
 
 ' Allow cells to be formatted on a protected worksheet. 
 If ActiveSheet.Protection.AllowFormattingCells = False Then 
 ActiveSheet.Protect AllowFormattingCells:=True 
 End If 
 
 MsgBox "Cells can be formatted on this protected worksheet." 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.