Hi all,
I have adapted some code to zoom in when data validated cells are selected, the code works perfect, my only querie is how do i get excel to remember the original zoom setting in vba rather than a cell. At the moment i pass the value of the zoom to a cell that will never be used but doing this for every sheet made the size of the workbook grow greatly, is there a way of passing the value to a procedure or portion of memory so that when the user clicks away from the validated cell it zooms back to its original setting?
Regards,
Simon
Here's what i have!
[VBA]
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim OriginalZoom
OriginalZoom = ActiveWindow.Zoom
Range("A65536").Value = OriginalZoom
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim MyZoom As Long
Dim DV
Dim OriginalZoom
OriginalZoom = ActiveWindow.Zoom
MyZoom = 120
DV = 0
Application.EnableEvents = False
On Error Resume Next
DV = ActiveCell.Validation.Type
If DV = 3 Then
ActiveWindow.Zoom = MyZoom
ElseIf lDVType = 0 Then
ActiveWindow.Zoom = Range("A65536").Value
Range("A" & ActiveCell.Row).Select
End If
Application.EnableEvents = True
End Sub
[/VBA]