Resizing Validation Listbox

mpopkowski

Board Regular
Joined
Jul 30, 2003
Messages
67
Is there anyway to resize a drop down list created when using validation. I can't see the complete list of my choices. I need to widen the list. Please tell me there is a way.

Thanks,
Mark :oops:
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I think you'll need to widen your column. You could also merge a couple of cells if you wanted to preserve formatting etc in other parts of the worksheet.
 
Upvote 0
I had hoped there was another way. Widening the column or cell will mess up the whole chart. Thanks for your reply.
 
Upvote 0
unfortunately, using data validation lists has it's drawbacks. mostly limited by the obvious - it's cell. but there are other options you could look at also, like a combo box.
 
Upvote 0
Hi Nate, I couldnt get that to work successfully (XL2002). What exactly are you doing? The size of the cells in the source data seems to have some significance and there is a Shape object for the dropdown which I wasnt aware of.

The arrow for the drop down on selection of the cell seemed to position itself to the left which showed less text on the list rather than showing more.
 
Upvote 0
Hello Parry, I have not tested this in XP, but...

Do a few things:

1) Set up a spreadsheet
2) Report the source range for your list. Make the source column width wider than the validation cell (it's only an example).
3) Report the cell housing your validation.

The example can be catered from here and should be more transparent. :)
 
Upvote 0
Hi Nate, changing the size of the source data column made all the difference and it was working. However, I was resizing the source data again and now the drop-down arrow is back to the default and the Selection Change isnt making any difference. Theres something screwy here.

Im going to have to experiment with a few things to see what actions caused the drop-down to return to normal. I think changing some of the cells where validation applies and/or resizing the source data columns has an adverse effect but Im unsure what exactly yet.

Heres some sample data I used and I have also put the size of the columns in as well. The value in D11 represents the size of column C if I auto-resized it by d-clicking and the value in C12 represents the difference between this and C11. Why I did this was because when it was working the size was actually bigger than it needed to be so I resized the source to 16.89 and it dit in nicely.

Ive also posted the code I used so you know what Im working with. The values in column B are there just to have data in between and no real reason. Of course the HTML Maker will resize the columns which is why I put the size in.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myShp As Shape, Drp As Single

On Error Resume Next

'cells holding drop downs
If Intersect(Target, [A1:A5]) Is Nothing Then Exit Sub
If Target.Validation.Type = xlValidateList Then
    Set myShp = ActiveSheet.Shapes("Drop Down 1")
    Drp = myShp.Width - Target.Width

'Column holding list, sized appropriately
    myShp.Width = [C:C].Width
    myShp.Left = Target.Left - myShp.Width / 2 + Drp * 2
End If

Set myShp = Nothing

End Sub
Book1
ABCD
1Robin1Batman
2Robin2Robin
3TheIncredibleHulk3WonderWoman
4WandaTheWickedWitch4TheIncredibleHulk
5WandaTheWickedWitch5WandaTheWickedWitch
6TheIncredibleHulk6CaptainMarvel
7Robin7TheGreenLantern
88Superman
9
10WidthWidthWidthWidth2
118.118.1116.8922.11
12Extra->5.22
Sheet1
 
Upvote 0
Oops forgot to say that cells in Column A have the data validation and Column C is the source for the list. Note I am aware that the range in the code is A1:A5 while I have validation in A1:A7. This ws done on purpose to see the difference between the validation boxes.

EDIT :

WTF? I had saved the book and closed it and then afer re-opening again it is now working fine. Im grasping at straws but perhaps the Shape Object (Drop Down 1) value had changed when I re-sized the validation area and this caused a problem but reset itself when the book was reopened. Is this then some Index # sort of arrangement???

Im lost :unsure:
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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