ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determine if a sheet is protected? (https://www.excelbanter.com/excel-programming/438552-determine-if-sheet-protected.html)

Robert Crandal

Determine if a sheet is protected?
 
How can I determine if a sheet is protected or not?

thank u



Bob Phillips[_4_]

Determine if a sheet is protected?
 
Try

activesheet.protectcontents

HTH

Bob

"Robert Crandal" wrote in message
...
How can I determine if a sheet is protected or not?

thank u





Gord Dibben

Determine if a sheet is protected?
 
Sub test()

MsgBox ActiveSheet.ProtectionMode 'returns true or false

End Sub


Gord Dibben MS Excel MVP

On Mon, 18 Jan 2010 16:28:18 -0700, "Robert Crandal"
wrote:

How can I determine if a sheet is protected or not?

thank u



Libby

Determine if a sheet is protected?
 
Hi Robert,

Sheet1.ProtectContents

True = protected, False = unprotected.


"Robert Crandal" wrote:

How can I determine if a sheet is protected or not?

thank u


.


Dave Peterson

Determine if a sheet is protected?
 
With worksheets("SomeSheetNameHere")
If .ProtectContents = True _
Or .ProtectDrawingObjects = True _
Or .ProtectScenarios = True Then
'it's protected
else
'it's not protected
End with



Robert Crandal wrote:

How can I determine if a sheet is protected or not?

thank u


--

Dave Peterson


All times are GMT +1. The time now is 11:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com