+ Reply to Thread
Results 1 to 5 of 5

How to skip values that cause mismatch error

  1. #1
    Registered User
    Join Date
    07-17-2019
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    5

    How to skip values that cause mismatch error

    I have a simple VBA code that functions fine provided there are not any symbols in any of the cells. When there are symbols, I get the mismatch error. I have included "On error resume next" in my loop; however, the previous value is output into a cell instead of leaving it blank. How do I adjust my code so that when there is a symbol in an input cell, the output cell remains blank instead of just having the previous value placed?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: How to skip values that cause mismatch error

    You should first check that cell holds numeric value.

    Ex:
    Please Login or Register  to view this content.
    Alternately you can use Application.Count() for checking.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: How to skip values that cause mismatch error

    @CK76,

    I think you will need to add the .Value property to the test otherwise Range will be returned rather than the typename for the contents.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: How to skip values that cause mismatch error

    Let the formula do the job.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: How to skip values that cause mismatch error

    Andy thanks for catching that one forgot to add it

+ 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. Type mismatch error after pasting values
    By jaydog0813 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2018, 11:21 AM
  2. [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
  3. Type mismatch error when assigning values resulting from a linear interpolation
    By seigna in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2015, 09:01 PM
  4. Type mismatch error- What is the reason behind the error message?
    By Endre111 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2014, 02:03 PM
  5. Complile Error: Type Mismatch ??? After adding error trap
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-22-2012, 03:50 PM
  6. Conditional Formatting - Run Time Error '13' Type Mismatch Error
    By ksp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-17-2011, 07:37 PM
  7. Type Mismatch error & subscript out of range error
    By Jeff Wright in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2005, 03:06 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