Drop Down List Zoom

rockyw

Well-known Member
Joined
Dec 26, 2010
Messages
1,196
Office Version
  1. 2010
Platform
  1. Windows
I found a code to zoom a validation dropdown list and then after selection it goes back to 100%. Problem is it also moves off the screen. Is there a way to keep this centered and still zoom up and down? Thanks

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveWindow.Zoom = 100
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim R As Range
Application.EnableEvents = False
On Error Resume Next
Set R = Range("C:C").SpecialCells(xlCellTypeAllValidation)
On Error GoTo 0
If R Is Nothing Then
    Application.EnableEvents = True
    Exit Sub
End If
If Not Intersect(Target, R) Is Nothing Then
    ActiveWindow.Zoom = 150
End If
Application.EnableEvents = True
End Sub
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I also added a second column

Private Sub Worksheet_Change(ByVal Target As Range)
ActiveWindow.Zoom = 100
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim R As Range
Application.EnableEvents = False
On Error Resume Next
Set R = Range("C:C","G:G").SpecialCells(xlCellTypeAllValidation)
On Error GoTo 0
If R Is Nothing Then
Application.EnableEvents = True
Exit Sub
End If
If Not Intersect(Target, R) Is Nothing Then
ActiveWindow.Zoom = 150
End If
Application.EnableEvents = True
End Sub
 
Upvote 0
I guess all I need added is to move the screen to the left where it started?
 
Upvote 0
Know one knows how to make a code change to make this screen scroll left after this code runs? I have found many things on line but none of them has worked. Thanks
 
Upvote 0
How about
Code:
ActiveWindow.Zoom = 150
Application.Goto Target, True
 
Upvote 0
That zooms all over the screen, what I need is it to stay where its at and zoom, then return to the same location. Right now the screen is alright in the C column but when I use column G the screen stays over to the right. I need it to return to the left side. Thanks
 
Upvote 0
When I use that the cell that was changed becomes the top left cell in the window.
Is that not what you want?
 
Upvote 0
What I would like it the cell to stay where its at and just zoom larger, then when selected it returns to the normal size and location. Right now when I select a drop down in G its zooms but then the screen stays to the right. I would like it to return to its original location. Thanks
 
Upvote 0
Whilst that is probably possible, I've no idea how to do it.
 
Upvote 0
I'm close really really close. Now if the selected cell with the drop down would center in screen that would be great...

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 ActiveWindow.Zoom = 71
 Application.Goto reference:=Range("a1"), scroll:=True
 
 End Sub

 Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 Dim R As Range
 Application.EnableEvents = False
 On Error Resume Next
 Set R = Range("C4:C24", "G4:G24").SpecialCells(xlCellTypeAllValidation)
 On Error GoTo 0
 If R Is Nothing Then
 Application.EnableEvents = True
 Exit Sub
 End If
 If Not Intersect(Target, R) Is Nothing Then
 ActiveWindow.Zoom = 150
 End If
 Application.EnableEvents = True
 
  End Sub
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top