+ Reply to Thread
Results 1 to 8 of 8

Could not set the value property. Type Mismatch

  1. #1
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Could not set the value property. Type Mismatch

    Can anyone help. I am trying to populate a text box from the selection in a combo box on a user form. I have a very simple code

    Please Login or Register  to view this content.
    It keeps giving me the error message "Could not set the value property. Type Mismatch"

    Can anyone tell me where I have gone wrong?

    Thanks

    Katie

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Could not set the value property. Type Mismatch

    maybe, if you attach a sample file
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Could not set the value property. Type Mismatch

    If the Vlookup function returns an error, then VBA throws an error when it applies the Vlookup error value to the textbox.

    Is the lookup value from the combobox a number? If yes, convert it from text to a number in the vlookup formula. The value type from the combobox is text. That could cause the Vlookup to error.

    This will convert the combobox value from string to long.
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Could not set the value property. Type Mismatch

    Thank you, I tried that and now it comes back with Syntax error? Any idea what that is?

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Could not set the value property. Type Mismatch

    Quote Originally Posted by katieshields View Post
    Thank you, I tried that and now it comes back with Syntax error? Any idea what that is?
    It means you didn't type it in correctly

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Could not set the value property. Type Mismatch

    I just read your other post. You could have one combobox with two (or more) columns of data. Would that work for you?

  7. #7
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Could not set the value property. Type Mismatch

    The other code works perfectly now, thanks. I was missing a )

    What do you mean one box with columns?

  8. #8
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Could not set the value property. Type Mismatch

    I do also have another issue now relating to this. The users will also need to input data that isn't necessarily in the pre populated data. There is a field earlier in the form which states new or existing. Is there anyway I can include this into the code? If existing auto populate, if new then a free text option?

+ 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. Run Type error 13 Type Mismatch
    By Affan Khan in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-13-2012, 12:58 PM
  2. [SOLVED] Run-type error 13 type mismatch
    By misop in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2012, 04:08 AM
  3. 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
  4. [SOLVED] Type mismatch using rnge as Range with Type 8 Input Box
    By STEVE BELL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-03-2005, 01:10 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

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