Results 1 to 4 of 4

Select matching item in userform combo box

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Select matching item in userform combo box

    I'm trying to select the correct name in a userform combo box. Below i've captured the engineers name in a variable from a separate worksheet, now i want to force the combo box to select the matching name, i can't seem to get this to work any suggestions

    Also any suggestions to eliminate all the repeatative if statements

    Thanks

    If myVar5 = "Bob" Then
        frmPlanning.cboEngineer.List = (.ListIndex = 0)
    End If
    If myVar5 = "Fred" Then
        frmPlanning.cboEngineer.List = (.ListIndex = 1)
    End If
    If myVar5 = "Larry" Then
        frmPlanning.cboEngineer.List = (.ListIndex = 2)
    End If
    If myVar5 = "Steve" Then
        frmPlanning.cboEngineer.List = (.ListIndex = 3)
    End If
    Last edited by jprlimey; 04-22-2014 at 02:16 PM. Reason: Solved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add range instead og item to combo in userform
    By Magnet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2012, 05:54 AM
  2. pre-select VB combo box item
    By finlander in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2011, 07:03 PM
  3. Select combobox item using string matching
    By TheFormerAstronomer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2011, 04:27 AM
  4. Select list item from combo box and add data
    By mli in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2009, 02:08 AM
  5. Auto Select Next Item in Combo Box
    By ssjody in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2006, 02:59 PM

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