+ Reply to Thread
Results 1 to 6 of 6

Runtime error '13' type mismatch when posting userform entries to excel table

  1. #1
    Registered User
    Join Date
    01-28-2016
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    5

    Unhappy Runtime error '13' type mismatch when posting userform entries to excel table

    Hi All.

    I am new to the forum (although I have received ample help as an "incognito" before).

    I have an Excel table which acts as a repository of various data types and gets populated through an Userform.

    The posting of the data, through a button, worked perfectly up until I meddled with the formatting of the individual fields in the table. Now I get a" Runtime error '13', type mismatch" at the code line where the Userform data are assigned to the fields in the table.

    The code I have used, without any problems, did not have variables declared, thus not all entry data types were correct i.e. some numerical values were entered as text due to the default Variant type etc.

    I have subsequently declared variable types according the combobox and textbox entries, but still resulting in same error. I'm running Office2013.

    Any help will be appreciated. Thanks
    Last edited by Deventre; 01-28-2016 at 11:39 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,085

    Re: Runtime error '13' type mismatch when posting userform entries to excel table

    Suggest that you post a sample workbook so that any solutions may be tested.

    It sounds though, that the clue is in the name ... you enter data into a Textbox so you're getting text. Hence the reason that you got text numbers rather than true numbers.

    You could try converting the Textbox values to the relevant types, for example, CLng, CDbl, CDate, etc., and see if that makes the problem(s) go away.

    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-28-2016
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    5

    Re: Runtime error '13' type mismatch when posting userform entries to excel table

    Thanks for the prompt reply TMS.

    I have attached an example workbook, that is giving the error when selecting the "add data" button on the userform.
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,085

    Re: Runtime error '13' type mismatch when posting userform entries to excel table

    Didn't try it then>

    You don't have to Dim objects that are on your user form.

    And you need the ActiveCell.Row, not ActiveCell.Rows

    Please Login or Register  to view this content.

    Regards, TMS

  5. #5
    Registered User
    Join Date
    01-28-2016
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    5

    Re: Runtime error '13' type mismatch when posting userform entries to excel table

    Much appreciated TMS. Issue resolved.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,085

    Re: Runtime error '13' type mismatch when posting userform entries to excel table

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Runtime error 13 type mismatch in Excel VBA
    By Juggler_IN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2015, 09:07 AM
  2. Runtime Error 13 type mismatch
    By Gauravsinghp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2014, 06:23 AM
  3. [SOLVED] Excel VBA Runtime Error 13 - Type Mismatch
    By mook25 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-01-2013, 07:30 AM
  4. RunTime Error 13 and Type Mismatch...
    By TheNewGuy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2010, 09:24 AM
  5. runtime error 13 type mismatch
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2009, 11:15 PM
  6. Runtime Error 13 - type mismatch
    By hindlehey in forum Excel General
    Replies: 1
    Last Post: 11-07-2005, 10:55 AM
  7. Runtime Error '13': Type mismatch
    By Linking to specific cells in pivot table in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2005, 03:06 PM

Tags for this Thread

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