I have a VBA code the hides columns based on 3 different cell values, but it is not working properly. If cell Z7 & Z33 do not equal "Black" AND if cell Z39 does not equal "Yes" then hide columns K:N. So I want the code to hide columns K:N if Z7 & Z33 <> "Black" and Z39 <> "Yes".
Code:
Sub Test()Application.ScreenUpdating = False
With Sheet10
If Sheet1.Range("Z7, Z33") <> "Black" And Sheet1.Range("Z39") <> "Yes" Then
.Columns("K:N").EntireColumn.Hidden = True
End If
End With
Application.ScreenUpdating = True
End Sub