+ Reply to Thread
Results 1 to 8 of 8

Overcoming runtime error Type13 mismatch with #N/A in cell

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Overcoming runtime error Type13 mismatch with #N/A in cell

    Hi All

    How can i overcome above error when trying to store unique values...Code thanks to Bakerman2

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Overcoming runtime error Type13 mismatch with #N/A in cell


    Hi !

    Try using IsError VBA function and avoid Goto statement …

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Overcoming runtime error Type13 mismatch with #N/A in cell

    Hi Marc L

    Thank you for your response...pls excuse my ignorance...Works well, however, still think I'm missing something...Your thoughts...
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Overcoming runtime error Type13 mismatch with #N/A in cell

    Or do not use goto
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    Thanks for the rep' !

    Quote Originally Posted by sintek View Post
    Works well, however, still think I'm missing something...Your thoughts...
    Quote Originally Posted by Marc L View Post
    Try using IsError VBA function and avoid Goto statement …
    PHP Code: 
    Sub Unique_Extract()
                 
    Dim V
        With CreateObject
    ("Scripting.Dictionary")
            For 
    Each V In Range(Sheet1.[A2], Sheet1.Cells(Rows.Count1).End(xlUp)).Value
                
    If Not IsError(VThen If "" Then .Item(V) = ""
            
    Next
                Sheet1
    .[B2].Resize(.Count).Value Application.Transpose(.Keys)
               .
    RemoveAll
        End With
    End Sub 
    Last edited by Marc L; 05-01-2018 at 12:12 AM. Reason: optimization …

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Overcoming runtime error Type13 mismatch with #N/A in cell

    Hi Phuocam

    Of course...Good catch
    Didn't not even think of using IsEmpty or <>
    Thanks.

    @ Marc L

    That's a nice one...Works well.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Overcoming runtime error Type13 mismatch with #N/A in cell


    If cells values are only numeric, you can use IsNumeric function instead of Not IsError

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Overcoming runtime error Type13 mismatch with #N/A in cell

    Values are both...so all good..Thanks again guys

+ 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] RunTime Error 13 ( type mismatch ) error is comming TextboxAfter_Update
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2017, 03:55 AM
  2. [SOLVED] Runtime Error 13 - Type Mismatch
    By trobb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-17-2017, 02:06 AM
  3. Runtime Error 13 Mismatch can anyone help
    By bloodmilksky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2016, 10:36 AM
  4. Type13 Mismatch on Find/offset
    By SamuelJackson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2014, 06:10 PM
  5. putting an if condition based on text in a cell - runtime error 13: type mismatch
    By rbs123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2013, 04:02 AM
  6. [SOLVED] Display cell reference - runtime error type mismatch
    By Brumbot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 06:44 AM
  7. type13 mismatch error message... any idea why?
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2005, 02:11 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