+ Reply to Thread
Results 1 to 4 of 4

VBA combo box

  1. #1
    Registered User
    Join Date
    07-14-2005
    Posts
    14

    VBA combo box

    hey all, easy question, cant find answer anywhere

    How do I add items to a combo box in a VBA Form at design mode? There is a LIST property but I can only add 1 item?

    Thanks in advance!

  2. #2
    Dave Peterson
    Guest

    Re: VBA combo box

    Scroll down to the RowSource property.

    Type in the range you want--if you're picking the list from a range.

    If you're adding items one at at time, you could do it in the
    UserForm_Initialize subroutine:

    with me.combobox1
    .additem "a"
    .additem "b"
    .additem "x"
    end with

    or even:
    Dim myList As Variant
    myList = Array("a", "b", "x")
    Me.ComboBox1.List = myList



    krhyme wrote:
    >
    > hey all, easy question, cant find answer anywhere
    >
    > How do I add items to a combo box in a VBA Form at design mode? There
    > is a LIST property but I can only add 1 item?
    >
    > Thanks in advance!
    >
    > --
    > krhyme
    > ------------------------------------------------------------------------
    > krhyme's Profile: http://www.excelforum.com/member.php...o&userid=25225
    > View this thread: http://www.excelforum.com/showthread...hreadid=396601


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    07-14-2005
    Posts
    14
    Perfect, Thanks Dave!

  4. #4
    Registered User
    Join Date
    07-14-2005
    Posts
    14
    It only shows the first item from my range, i tried ways:

    1. Sheet1:A1:A5 in rowSource

    2. insert-->name--> define and listName in rowSource

    My items are side by side instead of one of top of eachother, could that be a problem?

+ 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