View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
SteveM SteveM is offline
external usenet poster
 
Posts: 133
Default Cell to indicate protected sheet

On Feb 17, 5:54 am, Jim wrote:
Is there any way that a cell can be set up to indicate if a sheet is
protected or unprotected?

Thanks


Jim,

See ProtectContents and ProtectionMode in the Worksheets Object
Browser.

I think this should do it:

Public Function ProtectStatus() As String
Dim pStatus As Boolean

pStatus = ActiveSheet.Protect
If pStatus = True Then
ProtectStatus = "Protected"
Else
ProtectStatus = "Unprotected"
End If

End Function

Just select the cell you want to use as the indicator and then this
function from the User Defined list.

SteveM