+ Reply to Thread
Results 1 to 6 of 6

Run-Time Error ‘13’: Type Mismatch in Userform

  1. #1
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    368

    Run-Time Error ‘13’: Type Mismatch in Userform

    Dear Expert,

    Below mentioned code is on a User form Text box Named as “Qty”:

    In the Below Code:-

    Qty, C_LL, UOM_MM are a Text Boxes contains some value given by a user.

    F_Qty is a another textbox, based below logic I would want a Result. But when I execute the same. Getting an subjected Error, Kindly help me to amend the code which gives desired result!


    Please Login or Register  to view this content.
    Thanks & Regards,
    Rajeshkumar R
    Last edited by Rajeshkumar R; 10-21-2017 at 12:45 AM. Reason: Query Resolved

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

    Re: Run-Time Error ‘13’: Type Mismatch in Userform

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Run-Time Error ‘13’: Type Mismatch in Userform

    Your trying to put numeric results in a textbox it seems. You will likely need to convert the result to a string to be able to asign the value to a text box.

    see the cstr function.

    Keep in mind that the value in the textbox is then a string and not a number, so you may need to convert it back to a numeric value if "extracting" it from the text box for calculations after.

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

    Re: Run-Time Error ‘13’: Type Mismatch in Userform

    You don't need to convert numeric values to strings to put them in textboxes but there could be problems when using (text) values from textboxes in calculations.

    Also, if any of the textboxes you are using in the calculation is empty it could cause problems.

  5. #5
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Run-Time Error ‘13’: Type Mismatch in Userform

    Quote Originally Posted by Norie View Post
    You don't need to convert numeric values to strings to put them in textboxes but there could be problems when using (text) values from textboxes in calculations.

    Also, if any of the textboxes you are using in the calculation is empty it could cause problems.
    Ah actually thats a good point, its the issue is likely trying to do the math using the values from the text boxes, not storing the result in the text box like I said. Conceptually similar tho. Converting the values in the text boxes to numeric values prior to or within the calculation. You should check out the conversion functions to see which most closely resembles the type of numeric values you work with (Cdbl, Cint, etc)

  6. #6
    Forum Contributor
    Join Date
    01-07-2012
    Location
    Bangalore
    MS-Off Ver
    Office 365
    Posts
    368

    Re: Run-Time Error ‘13’: Type Mismatch in Userform

    Dear Friends,

    Thanks for your instant responses!

    As Mr. Norie said, there was a empty text box which used in my calculation, same is been corrected and code is working Fine Now!

    Regards,
    Rajeshkumar R

+ 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] Type Mismatch Error Populating a userform
    By Mack1981 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-24-2017, 07:40 PM
  2. Run-time error ‘13’: Type mismatch on Userform textbox if empty
    By dentler in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2017, 03:37 AM
  3. Type mismatch error in userform
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2016, 09:29 PM
  4. [SOLVED] Run time error 13 - Type mismatch
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2013, 08:30 AM
  5. Run-Time error 13 type mismatch - HELP
    By clundeen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-17-2013, 04:23 PM
  6. [SOLVED] Passing Userform Listbox to sub causes type-mismatch error
    By Kleev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2005, 04: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