+ Reply to Thread
Results 1 to 5 of 5

Listbox on a useform

  1. #1
    Registered User
    Join Date
    03-31-2006
    Posts
    39

    Listbox on a useform

    I am trying to add a listbox to a userform, but cannot work out how to add a list to the listbox!

    Any ideas?

    Thanks in advance.

  2. #2
    Chip Pearson
    Guest

    Re: Listbox on a useform

    If you want to fill the list with values from a worksheet range,
    set the ListFill property to that range. Otherwise, use the
    ..AddItem method:

    With UserForm1.ListBox1
    .AddItem "a"
    .AddItem "be"
    .AddItem "c"
    End With


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "ingleg" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I am trying to add a listbox to a userform, but cannot work out
    > how to
    > add a list to the listbox!
    >
    > Any ideas?
    >
    > Thanks in advance.
    >
    >
    > --
    > ingleg
    > ------------------------------------------------------------------------
    > ingleg's Profile:
    > http://www.excelforum.com/member.php...o&userid=33037
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=558494
    >




  3. #3
    Bob Phillips
    Guest

    Re: Listbox on a useform

    You either add each item

    With Listbox1
    .Additem "Bob"
    .AddItem "Jim"
    'etc.

    End With

    or else you link it to a worksheet range, via the RowSource property.

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "ingleg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I am trying to add a listbox to a userform, but cannot work out how to
    > add a list to the listbox!
    >
    > Any ideas?
    >
    > Thanks in advance.
    >
    >
    > --
    > ingleg
    > ------------------------------------------------------------------------
    > ingleg's Profile:

    http://www.excelforum.com/member.php...o&userid=33037
    > View this thread: http://www.excelforum.com/showthread...hreadid=558494
    >




  4. #4
    Chip Pearson
    Guest

    Re: Listbox on a useform

    ListFill should be RowSource.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Chip Pearson" <[email protected]> wrote in message
    news:[email protected]...
    > If you want to fill the list with values from a worksheet
    > range, set the ListFill property to that range. Otherwise, use
    > the .AddItem method:
    >
    > With UserForm1.ListBox1
    > .AddItem "a"
    > .AddItem "be"
    > .AddItem "c"
    > End With
    >
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    >
    >
    > "ingleg" <[email protected]>
    > wrote in message
    > news:[email protected]...
    >>
    >> I am trying to add a listbox to a userform, but cannot work
    >> out how to
    >> add a list to the listbox!
    >>
    >> Any ideas?
    >>
    >> Thanks in advance.
    >>
    >>
    >> --
    >> ingleg
    >> ------------------------------------------------------------------------
    >> ingleg's Profile:
    >> http://www.excelforum.com/member.php...o&userid=33037
    >> View this thread:
    >> http://www.excelforum.com/showthread...hreadid=558494
    >>

    >
    >




  5. #5
    Registered User
    Join Date
    03-31-2006
    Posts
    39
    Thanks Chip.

    I tried the Row source previously, but must have mis-typed the cell reference.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1