+ Reply to Thread
Results 1 to 11 of 11

Force user to only enter values from dropdown menu in combobox

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Force user to only enter values from dropdown menu in combobox

    Hi,
    i have this combobox in a userform which has a dropdown menu referring to Vendors in a specific sheet.
    How can i control the box so that only the items selected from the dropdown menu can be entered.
    I am trying to avoid the match only option under the properties because it doesn't let me customize the message box, and it won't let me clear the box if i decide i want to leave it empty.
    here is a code i have which displays the message box and let's me clear any entries and if i enter a name other than what's in the drop box the message box will appear. the only issue (which is a big issue) the code won't let me choose what's in the drop down menu.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Force user to only enter values from dropdown menu in combobox

    Hi,

    Why not use a ListBox rather than a ComboBox?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Force user to only enter values from dropdown menu in combobox

    In the properties of the combobox, set the MatchRequired field from false to true.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Force user to only enter values from dropdown menu in combobox

    Perhaps is this what you're looking for!!?

    Please Login or Register  to view this content.
    Last edited by jayesh25; 01-05-2015 at 02:03 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Force user to only enter values from dropdown menu in combobox

    Quote Originally Posted by jayesh25 View Post
    Perhaps is this what you're looking for!!?
    Hi jayesh25,
    Your code works just fine.
    Just curious if code can work right after user goes out of Combo Box as opposed to code working within the combobox.
    If not, don't worry too much about it, your code still does the main trick.

    Thanks!

  6. #6
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Force user to only enter values from dropdown menu in combobox

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Why not use a ListBox rather than a ComboBox?
    Hi Richard,
    I will look into your suggestion, i will need to change some of the script within the codes so i can test out the listbox.
    I will keep you posted.

    Thanks.

  7. #7
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Force user to only enter values from dropdown menu in combobox

    Quote Originally Posted by gmr4evr1 View Post
    In the properties of the combobox, set the MatchRequired field from false to true.
    Hi gmr4evr1,
    As mentioned in my first post, i am trying to avoid the MatchRequired option in the properties. If i use the Match option i will still have the issue of not being able to clear the box.

    Regards,

    kosherboy
    Last edited by kosherboy; 01-05-2015 at 04:18 PM.

  8. #8
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Force user to only enter values from dropdown menu in combobox

    My bad, I didn't verify about being able to clear the box.

  9. #9
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Force user to only enter values from dropdown menu in combobox

    Kosher, thanks.

    Yes you can just change that to this then..

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Force user to only enter values from dropdown menu in combobox

    Kosherboy, No issues.

    This should serve it the other way

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: Force user to only enter values from dropdown menu in combobox

    Super job! Code works very professionally
    Thanks a million

+ 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] userform: when selecting Combobox value force user to choose from second combobox
    By mortphil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-31-2014, 12:29 PM
  2. [SOLVED] Force user to enter certain characters
    By NJH88 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-08-2013, 09:33 AM
  3. Force user to enter specific alphabets in userform
    By saji in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2013, 10:22 AM
  4. [SOLVED] if statement to force user enter string without spacing
    By rename in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2012, 05:20 AM
  5. Force user to enter value in cells
    By staples in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2009, 05:17 AM

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