Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default How recognize sheet protected?

What code do I need in a macro to determine whether a sheet is protected or
not?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul B
 
Posts: n/a
Default How recognize sheet protected?

John, here is one way,

Sub Check__Sheet_Protection()
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
If .ProtectContents _
Or .ProtectDrawingObjects _
Or .ProtectScenarios Then
MsgBox "Protected sheet"
Exit Sub
Else
MsgBox "Unprotected Sheet"
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 2002 & 2003

"John" wrote in message
...
What code do I need in a macro to determine whether a sheet is protected
or
not?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protected Sheet Message tlosgyl3 Excel Discussion (Misc queries) 2 December 8th 05 08:13 AM
Applying autofilter to protected sheet Brian Ferris Excel Discussion (Misc queries) 2 November 18th 05 04:28 PM
Protected sheet to unprotected sheet [email protected] Excel Worksheet Functions 2 October 26th 05 05:30 PM
Copying multiple sheets from one book 2 another and undertake spec Pank Mehta Excel Discussion (Misc queries) 14 March 16th 05 04:41 PM
Naming & renaming a sheet tab Cgbilliar Excel Worksheet Functions 1 November 7th 04 05:57 PM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"