+ Reply to Thread
Results 1 to 6 of 6

Combo Box in User Form gives a Type Mismatch Error

  1. #1
    Forum Contributor
    Join Date
    07-13-2014
    Location
    Three Rivers
    MS-Off Ver
    365
    Posts
    127

    Combo Box in User Form gives a Type Mismatch Error

    Hi, hope someone can help!

    I have combo box in a user form where I get a Type Mismatch error when instead of selecting an option from the drop down menu, you type in the combo box which would then use predictive text.

    The problem comes when you accidentally type wrong then it would give a Type Mismatch error. See attachment

    Is there any way of preventing this error from happening? Maybe a message telling the user that they typed wrong and to retype again or select the correct option?

    Thanx
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Combo Box in User Form gives a Type Mismatch Error

    That code was trying to set the .Value of the combo box before it had anything in its list.

    Also, instead of using the End command, one should Unload the user form when the close button is clicked.

    You might replace all that UF code with this. Note that the VLOOKUPS have been replaced by using a two column ComboBox. Since the RowSource property is not supported in all versions of Excel, that was changed as well.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    06-04-2013
    Location
    Moscow
    MS-Off Ver
    Office 365
    Posts
    100

    Re: Combo Box in User Form gives a Type Mismatch Error

    For ComboBox set value 2-fmStyleDropDownList in Properties window. Name of Property - Style
    I'm sorry my english...

  4. #4
    Forum Contributor
    Join Date
    07-13-2014
    Location
    Three Rivers
    MS-Off Ver
    365
    Posts
    127

    Re: Combo Box in User Form gives a Type Mismatch Error

    Hi mikerickson

    Awesome thank you!

  5. #5
    Forum Contributor
    Join Date
    07-13-2014
    Location
    Three Rivers
    MS-Off Ver
    365
    Posts
    127

    Re: Combo Box in User Form gives a Type Mismatch Error

    Hi The Prist

    Thanx your way also worked however in my main workbook, I have a lot of options in the combo box and it would be easier if the user could type in the option activating the predictive text in order to find the option they were looking for a bit quicker than to scroll down to what they were looking for.

    But thanx anyway for the reply

  6. #6
    Forum Contributor
    Join Date
    06-04-2013
    Location
    Moscow
    MS-Off Ver
    Office 365
    Posts
    100

    Re: Combo Box in User Form gives a Type Mismatch Error

    Properties -MatchEntry -0-fmMatchEntryFirstLetter

+ 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] Clearing a Combo Box then trying to submit user form to Workbook gives error messages
    By colvinb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2012, 02:18 PM
  2. Error when populating cell with “Time” from combo box in user form
    By jwala in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-07-2010, 09:01 AM
  3. type mismatch error in form code
    By jay11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2010, 02:25 PM
  4. [SOLVED] Type Mismatch: array or user defined type expected
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 10:45 AM
  5. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM
  6. Type mismatch error on form show
    By Darach in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2005, 08:05 AM
  7. [SOLVED] Run Time Error 424 Combo Box User Form
    By Jennifer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2005, 04:06 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