PDA

View Full Version : Reg: Dropdown width



vidya lakshm
10-19-2010, 03:57 AM
Hi,
I have implemented & populated the dropdown using the below code,
Sub Drp1()
Dim lb
Dim rng

Set rng = Worksheets(ActiveSheet.Name).Range("A1")
Set lb = Worksheets(ActiveSheet.Name).DropDowns.Add(Left:=rng.Left, Top:=rng.Top, Width:=rng.Width, Height:=rng.Height, Editable:=False)
lb.AddItem "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
lb.AddItem "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
lb.AddItem "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
lb.Name = ActiveSheet.Name + "drp:" & 1
lb.OnAction = "DrpChange"

End Sub
Sub DrpChange()
MsgBox ("Hello")
End Sub
The problem that I am facing is , the entire contents is not visible.
How do i solve this problem without compromising on the look & feel of the sheet
Regards
Vidya

Aussiebear
10-19-2010, 02:10 PM
Are you happy to insert an active x combobox or listbox instead? This way the dropdown does not have to tied to a column width and you can adjust both height and width to suit your requirements

Bob Phillips
10-20-2010, 12:22 AM
What sort of dropdown is it? I would suggest widening it on clicking the driopdown arrow, then reset after selection.

Bob Phillips
10-20-2010, 02:02 AM
Also cross-posted at Xtreme VBTalk http://www.xtremevbtalk.com/showthread.php?t=318615