+ Reply to Thread
Results 1 to 5 of 5

userform: when selecting Combobox value force user to choose from second combobox

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    userform: when selecting Combobox value force user to choose from second combobox

    Hi everyone,

    I am trying to force the user to select values in 2 different ComboBox before diving into the "ComboBox_change'' event.

    I would need:
    1 - Select a value from ComboBox1 eg: "Choice 1"
    2 - When I selected a value in ComboBox1, I want it, to force me to choose a value in ComboBox2 before continuing with the rest of the code.

    suggestions would be very useful. thanks in advance for your time.
    -Phil

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: userform: when selecting Combobox value force user to choose from second combobox

    If you want to check a selection has been made in both comboboxes try this.
    Please Login or Register  to view this content.
    The code won't get past the If statement unless a selection has been made in both comboboxes.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    Re: userform: when selecting Combobox value force user to choose from second combobox

    Thanks Norie,

    that is exactly what I needed. Just out of curiosity "combobox1.listindex = -1" is it some sort of Combobox.value = "" ?

    Thanks again for your answer

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: userform: when selecting Combobox value force user to choose from second combobox

    The ListIndex property tells you the index of the selected item in the combobox, if it's -1 nothing has been selected.

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    Re: userform: when selecting Combobox value force user to choose from second combobox

    Thank you, I'll remember that!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  2. Userform - selecting data for combobox 2 basedon slection in combobox 1
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2013, 04:27 PM
  3. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  4. Userform Combobox - Choose Multiple Items from list and input on seperate lines
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2012, 04:09 PM
  5. Combobox on Userform not selecting correct data
    By frostie77 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2010, 05:15 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