Hello, I have an event code that will zoom in to make data validation drop-down menu choices appear larger for easier reading when you click a cell that contains the drop-down menu. The code is as follows:
I've put this code in a couple different files we use here at work, but we recently upgraded our Excel versions to 365. I created a co-authored file and it has a drop-down menu in it. I tried seeing if I could use the code above to do the same thing in this file. I had gone under Automate and New script and pasted the code there, but it didn't work - no zoom. I'm just wondering if it is not possible when the file is viewed/edited online to have codes like this one work and it only works on the desktop, if there is another step I should have taken for this, or if the code needs altered?
VBA Code:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim lZoom As Long
Dim lZoomDV As Long
Dim lDVType As Long
lZoom = 100
lZoomDV = 150
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
I've put this code in a couple different files we use here at work, but we recently upgraded our Excel versions to 365. I created a co-authored file and it has a drop-down menu in it. I tried seeing if I could use the code above to do the same thing in this file. I had gone under Automate and New script and pasted the code there, but it didn't work - no zoom. I'm just wondering if it is not possible when the file is viewed/edited online to have codes like this one work and it only works on the desktop, if there is another step I should have taken for this, or if the code needs altered?