Hello, I have a worksheet with several data validation cells. I also have a macro to zoom into each DV cell when selected, to 140%, then back to 100% when any other cell other than a DV cell is selected. The code works great except in protected mode. I have tried using the standard "Protect" and "Unprotect" vba codes, and protect userinterface codes . The zoom macro ( in protected mode) zooms into the 140% but then stops after that. It will not zoom back out to 100%. Once it stops, the code will not work after that. Here is the zoom code I am using.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim lZoom As Long Dim lZoomDV As Long Dim lDVType As Long lZoom = 100 lZoomDV = 180 lDVType = 0 Application.EnableEvents = False On Error Resume Next lDVType = Target.Validation.Type On Error GoTo errHandler If lDVType <> 3 Then With ActiveWindow If .Zoom <> lZoom Then .Zoom = lZoom End If End With Else With ActiveWindow If .Zoom <> lZoomDV Then .Zoom = lZoomDV End If End With End If exitHandler: Application.EnableEvents = True Exit Sub errHandler: GoTo exitHandler End Sub