Magnified Dropdown lists

HappyChappy

Active Member
Joined
Jan 26, 2013
Messages
378
Office Version
  1. 2019
  2. 2010
  3. 2007
Platform
  1. Windows
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Column
Case "2", "7", "11", "13"
ActiveWindow.Zoom = 130
Case Else
ActiveWindow.Zoom = 65
End Select
If Target.Address = "$D$1" Then ActiveWindow.Zoom = 130
End Sub

This code work's great it acts on a single cell or whole column it was a solution by a member of the group and it works .
But there is always a but, I was wondering can it be adapted to cover a range of cells rather then coloums. ie: d1:d20 and f1:f20 etc because some of my columns layout changes after row 20 and i dont want the whole column to be magnified.
 
I'm not home now but am I right in thinking the zoom figures are round the wrong way?
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Entered Mikes code and nothing happens, Paste the alternative code it and it runs ok please help
 

Attachments

  • capture.png
    capture.png
    34.9 KB · Views: 4
Upvote 0
The code you posted should look like this:
But I'm not sure if this is all the ranges you want.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.Intersect(Target, Me.Range("D1:D20, F1:F20")) Is Nothing Then
    ActiveWindow.Zoom = 65
Else
    ActiveWindow.Zoom = 130
End If
End Sub
 
Upvote 0
Works like a charm you sir are a diamond. thanks for the patience in showing me the path....
 
Upvote 0
The range i have is seven differnt ranges but just extrapolated from you code..
 
Upvote 0
many more then two seven is many more. for now that's good the code can be expanded easily so it's all gravy.. Once again many thanks
 
Upvote 0
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.Intersect(Target, Me.Range("b3:b30, b47:b73, g3:g30, k3:k30, m3:m30, d1:d2, o47:eek:60")) Is Nothing Then
ActiveWindow.Zoom = 65
Else
ActiveWindow.Zoom = 130
End If
End Sub

my current code
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,678
Members
449,116
Latest member
HypnoFant

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