+ Reply to Thread
Results 1 to 3 of 3

pre-select VB combo box item

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2003
    Posts
    20

    pre-select VB combo box item

    easy question, can't believe I haven't been able to find the answer.

    I have a drop-down combo box on a user form, runs on VB. I'd simply like the first item in the list to be pre-selected when the form initializes. I already have SetFocus to put the focus on the combo box, but that does not select the first item in the list in the combo box.

    this must be easy to do..
    thanks..

    UPDATE: I found it -- can look something like this:
    Me.id_product.ListIndex = 0
    Last edited by finlander; 06-10-2011 at 06:54 PM. Reason: mark as Solved

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: pre-select VB combo box item

    finlander,

    You would set the combobox's ListIndex. ListIndex = -1 when there are no items selected, and the first item is ListIndex = 0, so:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    06-07-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2003
    Posts
    20

    Re: pre-select VB combo box item

    thanks tigeravatar, got that resolved.
    Last edited by finlander; 06-10-2011 at 07:37 PM. Reason: move second question to new thread

+ 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