+ Reply to Thread
Results 1 to 4 of 4

Listbox item not rounding to 2 decimals - Runtime error 13 Type mismatch

  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Listbox item not rounding to 2 decimals - Runtime error 13 Type mismatch

    Hi All

    I have the following code which populates a listbox on UserForm initialize. Column G and I are formated as percentage. I am trying to get the listbox to populate with those columns as two decimals....I keep getting a runtime time error 13 Type mismatch.
    Please Login or Register  to view this content.
    Error on these two lines of code...Can anyone please advise

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Listbox item not rounding to 2 decimals - Runtime error 13 Type mismatch

    By the way...The rows of Column G And I contain formula's...Could this be causing the problem

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Listbox item not rounding to 2 decimals - Runtime error 13 Type mismatch

    Not to worry all...Deleted formulas and now am populationg sheet with VBA formula's

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

    Re: Listbox item not rounding to 2 decimals - Runtime error 13 Type mismatch

    The presence of formulas is not the problem, my guess is that those formulas are returning strings rather than numbers.

    Adding the VAL function to the code in the OP should prevent the error

    Please Login or Register  to view this content.
    Or, if the formula might return an error value (e.g. #DIV/0)

    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.

+ 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
    By jimcuk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-25-2016, 01:32 PM
  2. listbox runtime error 13 type mismatch
    By aprildu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2015, 02:27 AM
  3. [SOLVED] Runtime Error 13 type mismatch
    By Gauravsinghp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-18-2014, 06:29 AM
  4. Runtime error'13' - type mismatch
    By Polluz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2014, 01:12 PM
  5. Type Mismatch Runtime Error
    By Jaeger in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-21-2014, 10:49 AM
  6. Runtime Error 13 Type Mismatch
    By vtsoldier2010 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-30-2012, 12:59 PM
  7. RunTime Error 13 and Type Mismatch...
    By TheNewGuy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-24-2010, 09:24 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