Dropdown list width

NSegna

New Member
Joined
May 30, 2019
Messages
11
Hello,
I was wonder if there is a way to increase the width of a dropdown list.
I know that the width of the list is usually the same as the width of the column it is inbut I was wondering if it was possible to make it bigger all of the options are cut off.
I've tried to use this code but it does not seem to be working.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 2 Then
Target.Columns.ColumnWidth = 30
Else
Columns(2).ColumnWidth = 5
End If
End Sub


Thanks
 
Last edited:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Put the 2 following events

Code:
Private Sub [COLOR=#008000]Worksheet_Change[/COLOR](ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 2 Then
        Target.Columns.EntireColumn.AutoFit
    End If
End Sub


Private Sub [COLOR=#008000]Worksheet_SelectionChange[/COLOR](ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 2 Then
        Target.Columns.EntireColumn.AutoFit
    End If
End Sub
 
Upvote 0
Was it pasted to a normal Module? Because it's a worksheet event, meaning you have to place the code inside the sheet (Right click sheet name, click view code, paste code in white blank space)
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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