close

My users are working with a worksheet that has protection on most of the
time, but without a password, just to help prevent accidents. It would be
nice if there was a big red cell somewhere that said quot;Protectedquot; or quot;Not
protectedquot;. Is there a function that can display protection status? If not,
anyone have a good suggestion for achieving this effect?

Thanks,
Geoff.

Hi Geoff........
Some one (don't remember who) gave me this, some time back......it works
fine.....maybe you can use it.....

Public Sub ToggleProtectWithIndication()
'This will add quot;##quot; to the SheetName on the Tab when you unprotect the sheet,
'and remove it when you reprotect it.
Const PWORD As String = quot;drowssapquot;
Dim wkSht As Worksheet

With ActiveSheet
If .ProtectContents Then
.Unprotect Password:=PWORD
.Name = .Name amp; quot;##quot;
Else
.Protect Password:=PWORD
If .Name Like quot;*[##]quot; Then _
.Name = Left(.Name, Len(.Name) - 2)
End If
End With
End Sub

Vaya con Dios,
Chuck, CABGx3
quot;Geoff Cquot; wrote:

gt; My users are working with a worksheet that has protection on most of the
gt; time, but without a password, just to help prevent accidents. It would be
gt; nice if there was a big red cell somewhere that said quot;Protectedquot; or quot;Not
gt; protectedquot;. Is there a function that can display protection status? If not,
gt; anyone have a good suggestion for achieving this effect?
gt;
gt; Thanks,
gt; Geoff.

Close enough! Many thanks, Geoff.

quot;CLRquot; wrote:

gt; Hi Geoff........
gt; Some one (don't remember who) gave me this, some time back......it works
gt; fine.....maybe you can use it.....
gt;
gt; Public Sub ToggleProtectWithIndication()
gt; 'This will add quot;##quot; to the SheetName on the Tab when you unprotect the sheet,
gt; 'and remove it when you reprotect it.
gt; Const PWORD As String = quot;drowssapquot;
gt; Dim wkSht As Worksheet
gt;
gt; With ActiveSheet
gt; If .ProtectContents Then
gt; .Unprotect Password:=PWORD
gt; .Name = .Name amp; quot;##quot;
gt; Else
gt; .Protect Password:=PWORD
gt; If .Name Like quot;*[##]quot; Then _
gt; .Name = Left(.Name, Len(.Name) - 2)
gt; End If
gt; End With
gt; End Sub
gt;
gt; Vaya con Dios,
gt; Chuck, CABGx3
gt;
gt;
gt;
gt; quot;Geoff Cquot; wrote:
gt;
gt; gt; My users are working with a worksheet that has protection on most of the
gt; gt; time, but without a password, just to help prevent accidents. It would be
gt; gt; nice if there was a big red cell somewhere that said quot;Protectedquot; or quot;Not
gt; gt; protectedquot;. Is there a function that can display protection status? If not,
gt; gt; anyone have a good suggestion for achieving this effect?
gt; gt;
gt; gt; Thanks,
gt; gt; Geoff.

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()