Consulting

Results 1 to 4 of 4

Thread: Reg: Dropdown width

  1. #1

    Reg: Dropdown width

    Hi,
    I have implemented & populated the dropdown using the below code,
    [VBA]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[/VBA]
    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

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,057
    Location
    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
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What sort of dropdown is it? I would suggest widening it on clicking the driopdown arrow, then reset after selection.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Also cross-posted at Xtreme VBTalk http://www.xtremevbtalk.com/showthread.php?t=318615
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •