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.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Modified  3/14/2020  6:24:02 AM  EST
If Target.Row < 21 Then
Select Case Target.Column
Case "4", "6"
ActiveWindow.Zoom = 130
Case Else
ActiveWindow.Zoom = 65
End Select
If Target.Address = "$D$1" Then ActiveWindow.Zoom = 130
End If
End Sub
 
Upvote 0
Something like this perhaps

VBA Code:
If Application.Intersect(Target, Me.Range("D1:D20, F1:F20")) Is Nothing Then
    ActiveWindow.Zoom = 65
Else
    ActiveWindow.Zoom = 130
End If
 
Upvote 0
this is good but i want to cover multiply ranges at various parts of the worksheets for instance d1:d20 F1:f20 f35:f:50 r:20:r:39
 
Upvote 0
this is good but i want to cover multiply ranges at various parts of the worksheets for instance d1:d20 F1:f20 f35:f:50 r:20:r:39
To get what you want you must be specific. You never mentioned this.
So we need all specific Ranges.
 
Upvote 0
Mike's code works fine for me in a Worksheet event code in the sheet module :unsure: Have you disabled events?
 
Upvote 0
You don't want to. Run the below to make sure that they are enabled then try Mike's code inside a Worksheet event code.
VBA Code:
Sub enanableit()
Application.EnableEvents = True
End Sub
If it still doesn't work post in the thread the complete code that you are using and are you getting any error messages?
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,299
Members
448,885
Latest member
LokiSonic

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