Link to home
Create AccountLog in
Avatar of Charlie9200
Charlie9200

asked on

prevent autofilter on one sheet

I have this VBA in ThisWorkbook.  How can it be re-written to avoid autofileter in Sheet 2 called "Health Check Scorecard"?
Sub Workbook_Open()

  Application.ScreenUpdating = False
    Dim wkSht As Worksheet


    For Each wkSht In ActiveWorkbook.Worksheets
        With wkSht
            If .ProtectContents = True Then .Protect UserInterfaceOnly:=True, AllowFiltering:=True, Password:="awake"
            If .AutoFilterMode Then
                If .FilterMode Then
                    .ShowAllData
                End If
            Else
                If .FilterMode Then
                    .ShowAllData
                End If
            End If
          If .Visible = xlSheetVisible Then
            .Select
            .[a1].Select
 
            With ActiveWindow
              .Zoom = 75
              .ScrollRow = 1
              .ScrollColumn = 1
            End With
          End If
        End With
    Next wkSht
     
    Worksheets(1).Select
  Application.ScreenUpdating = True
End Sub
ASKER CERTIFIED SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account