+ Reply to Thread
Results 1 to 3 of 3

Display worksheet protection status in a cell?

  1. #1
    Geoff C
    Guest

    Display worksheet protection status in a cell?

    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 "Protected" or "Not
    protected". Is there a function that can display protection status? If not,
    anyone have a good suggestion for achieving this effect?

    Thanks,
    Geoff.

  2. #2
    CLR
    Guest

    RE: Display worksheet protection status in a cell?

    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 "##" to the SheetName on the Tab when you unprotect the sheet,
    'and remove it when you reprotect it.
    Const PWORD As String = "drowssap"
    Dim wkSht As Worksheet

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

    Vaya con Dios,
    Chuck, CABGx3



    "Geoff C" wrote:

    > 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 "Protected" or "Not
    > protected". Is there a function that can display protection status? If not,
    > anyone have a good suggestion for achieving this effect?
    >
    > Thanks,
    > Geoff.


  3. #3
    Geoff C
    Guest

    RE: Display worksheet protection status in a cell?

    Close enough! Many thanks, Geoff.

    "CLR" wrote:

    > 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 "##" to the SheetName on the Tab when you unprotect the sheet,
    > 'and remove it when you reprotect it.
    > Const PWORD As String = "drowssap"
    > Dim wkSht As Worksheet
    >
    > With ActiveSheet
    > If .ProtectContents Then
    > .Unprotect Password:=PWORD
    > .Name = .Name & "##"
    > Else
    > .Protect Password:=PWORD
    > If .Name Like "*[##]" Then _
    > .Name = Left(.Name, Len(.Name) - 2)
    > End If
    > End With
    > End Sub
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    >
    > "Geoff C" wrote:
    >
    > > 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 "Protected" or "Not
    > > protected". Is there a function that can display protection status? If not,
    > > anyone have a good suggestion for achieving this effect?
    > >
    > > Thanks,
    > > Geoff.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1