+ Reply to Thread
Results 1 to 5 of 5

How do I enter values in a Combo Box with Excel

  1. #1
    James-pps
    Guest

    How do I enter values in a Combo Box with Excel

    Hi,
    I'm struggling to enter values into a Combo Box, I understand that I need to
    Script it, but can't work out how! I've tried using the Help function in VB
    section but to no avail.

    Thanks
    James

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    where did you get the combo box from??

    Control ToolBox
    or
    Forms ToolBox

    Make a list in your worksheet
    Name the list by highliting it and then goto=>insert=>name=>define
    put a one word name in the name box
    if you used the combo box from the controll toolbox then..
    right click on the combobox select properties, find rowsource and enter the named range, now your box is populated,

    Combobox from the forms toolbar,
    rightclick on the combo box
    select format control
    select the control tab
    input range, enter the range name or you can just click on the squarde button and go to the range and highlite it and click ok

    If you are using a combo Box for a UserForm you can populate it the same way as the first explaination,
    select the combobox on the userform, be sure it says combobox on the properties window, go down to row source and enter the name of the range

  3. #3
    Chip Pearson
    Guest

    Re: How do I enter values in a Combo Box with Excel

    James,

    Try some code like the following:

    With UserForm1.ComboBox1
    .AddItem "a"
    .AddItem "b"
    .AddItem "co"
    End With



    "James-pps" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi,
    > I'm struggling to enter values into a Combo Box, I understand
    > that I need to
    > Script it, but can't work out how! I've tried using the Help
    > function in VB
    > section but to no avail.
    >
    > Thanks
    > James




  4. #4
    James-pps
    Guest

    Re: How do I enter values in a Combo Box with Excel

    Thanks, I've tried that but when I click the arrow, I get a blank dropdown
    line.

    However I have found a way of doing it, instead of selecting a Combo Box
    from the Control Toolbox, I inserted one from the Forms Toolbox. Then I could
    right click on the object, select Format Control, and then under the control
    tab, enter an input range for criteria.

    Thanks for your prompt reply

    James

    "Chip Pearson" wrote:

    > James,
    >
    > Try some code like the following:
    >
    > With UserForm1.ComboBox1
    > .AddItem "a"
    > .AddItem "b"
    > .AddItem "co"
    > End With
    >
    >
    >
    > "James-pps" <[email protected]> wrote in
    > message
    > news:[email protected]...
    > > Hi,
    > > I'm struggling to enter values into a Combo Box, I understand
    > > that I need to
    > > Script it, but can't work out how! I've tried using the Help
    > > function in VB
    > > section but to no avail.
    > >
    > > Thanks
    > > James

    >
    >
    >


  5. #5
    Registered User
    Join Date
    03-13-2006
    Posts
    47
    Dears

    And I wonder how we can choose the combobox to enter without using mouse.

    Regards.
    OverAC

+ 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