Please Help!!! With Drop-down List

S

seantera

Is there any way to control how the dropdown list is displayed
Specifically, I have a data validation list in a cell. The column it i
in is only 4 units wide, with the text aligned at 90 degree
(vertically). The dropdown list displayed is also only 4 units wide
and does not show enough characters of each list item. I've seen othe
spreadsheets where the dropdown list is wider than the column, but i
seems to be somewhat random...

Is there any way to increase the size (or other properties) of th
dropdown list (apart from increasing the column width)
 
H

hideki

Hi seantera,

May be this is not the best solution but you can use this in the sheet
selection change event.

This assuming that your listbox is in the cell "E1". Please change t
suit yours. And you need to check at the VBE immidiate window to se
the correct name for your drop down list. Here I only have one dro
down list, so the name is "Drop Down 1).

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim s As Shape
Dim BtnWidth As Single
With ActiveCell
Select Case .Address(False, False)
Case "E1"
If .Validation.Type = xlValidateList Then
Set s = ActiveSheet.Shapes("Drop Down 1")
BtnWidth = s.Width - .Width
s.Width = 150
s.Left = .Left + .Width - s.Width + BtnWidth
Set s = Nothing
End If
End Select
End With
End Sub

Best regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top