Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filling a combobox list (xl2k)

    I'm having difficulty setting the ListFillRange with vba code.
    How do I adjust the following?


    ActiveSheet.Shapes(1).ControlFormat.ListFillRange = Range("PrimAppList")

    ----Shape(1) is the combobox
    ----"PrimAppList" is a range on the activesheet contianing the desire list of items.
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filling a combobox list (xl2k)

    The ListFillRange property is a string, not a range as the name seems to imply. So use:

    Activesheet.Shapes(1).ControlFormat.ListFillRange = "PrimAppList"

  3. #3
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filling a combobox list (xl2k)

    Hans,

    This still doesn't work for me. Any ideas why?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filling a combobox list (xl2k)

    Did you create the combo box from the Forms toolbar? In that case, the code I posted should work. If you created it from the Control Toolbox, use the following instead:

    ActiveSheet.OLEObjects(1).ListFillRange = "PrimAppList"

  5. #5
    3 Star Lounger
    Join Date
    Feb 2003
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filling a combobox list (xl2k)

    that did the trick.
    thanks

Posting Permissions

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