+ Reply to Thread
Results 1 to 4 of 4

Sheet Protection Interference

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,051

    Re: Sheet Protection Interference

    Thanks SHG,

    I was hoping for a less brute force approach, but couldn't find one. So now I've written in a ton of Unprotect/Protect sequences to make it work. Corrected Macro code is below.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim ws As Worksheet:    Set ws = Sheets("View1Pivot")
    Dim ws2 As Worksheet:   Set ws2 = Sheets("Chart-View 1")
    
    
    If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
    
        If Target.Address = "$E$1" Then
        ws.unprotect
        ws.Range("N:N").AutoFilter Field:=1, Criteria1:=ws2.Range("E1").Text
        ws.protect
    End If
    
    End Sub
    Thanks for pointing me in the right direction.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Sheet Protection Interference

    You can also protect the sheet with UserInterfaceOnly:=True, but that works for some things and not others.
    Entia non sunt multiplicanda sine necessitate

+ 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