• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Increasing size of dropdown box

Hi, novice user here....

Is there a way to make the dropdown box in AD41 large enough to view all of the content ONLY when selecting the dropdown? The box would then return to normal size when another cell is selected. I found the code below online but don't understand how it works - when I increase the values for intZoom & intZoomDV, the size of the box doesn't change.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rngDV As Range
Dim intZoom As Integer
Dim intZoomDV As Integer
intZoom = 60
intZoomDV = 125
ActiveSheet.Unprotect
Application.EnableEvents = False
On Error Resume Next
Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo errHandler
If rngDV Is Nothing Then GoTo errHandler

If Intersect(Target, rngDV) Is Nothing Then
With ActiveWindow
If .Zoom <> intZoom Then
.Zoom = intZoom
End If
End With
Else
With ActiveWindow
If .Zoom <> intZoomDV Then
.Zoom = intZoomDV
End If
End With
End If
exitHandler:
Application.EnableEvents = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Exit Sub
errHandler:
GoTo exitHandler
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub
Also, is there a way to not have to add the = when I've made my selection to make a formula? Is there a way to just get the value of the equation populate the cell?

thank you,
Hank
 

Attachments

  • Book2.xlsx
    28.9 KB · Views: 5
Last edited by a moderator:
Back
Top