Hi all,
I need to modify the below code so the lzoom returns to the previous setting for the worksheet in question. I'd specify the number but I have another macro that changes the worksheet zoom based on the user's screen resolution so the figure will be different in each case. Can I not use lzoom = previous or default, or something similar?
Thanks in advance...
PHP Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim lZoom As Long
Dim lZoomDV As Long
Dim lDVType As Long
lZoom = [B]70[/B]
lZoomDV = 120
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
Bookmarks