ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check protection (https://www.excelbanter.com/excel-programming/313561-check-protection.html)

masterphilch

check protection
 
How can I check through VBA if a worksheet is protectet or not?

thx

Paul B[_8_]

check protection
 
masterphilch. here is one way

Sub testme()
With ActiveSheet
If .ProtectContents Then
MsgBox "Sheet is protected"
Else
MsgBox "Sheet is not protected"
End If
End With
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **

"masterphilch" wrote in message
...
How can I check through VBA if a worksheet is protectet or not?

thx




masterphilch

check protection
 
that was fast!!
thanks a lot

Paul B wrote:

masterphilch. here is one way

Sub testme()
With ActiveSheet
If .ProtectContents Then
MsgBox "Sheet is protected"
Else
MsgBox "Sheet is not protected"
End If
End With
End Sub



All times are GMT +1. The time now is 04:21 AM.

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