+ Reply to Thread
Results 1 to 5 of 5

#Value in array causing Type Mismatch in comparision

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    #Value in array causing Type Mismatch in comparision

    Hi,

    I have an array of numbers which was obtained from col-A of the enclosed input file. To keep things simple there are only 15 entries in the column. However, there is "#Value!" entry in row 6.

    My goal is to "do something" if the number is greater than 25 and to do something else if its less than 25. The problem is that when making the comparison i get a "TypeMismatch" error.

    Any ideas how to solve this?
    Attached Files Attached Files

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

    Re: #Value in array causing Type Mismatch in comparision

    Check for the error with IsError.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: #Value in array causing Type Mismatch in comparision

    Or change the #value! into 0 or blanc

    CTRL + H

    find #Value!

    replace by 0 (or blanc)

    Then you are able to do your calculation
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: #Value in array causing Type Mismatch in comparision

    To add some species to Norie's code.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: #Value in array causing Type Mismatch in comparision

    thanks ....... guess i need to check if its an error first........

+ 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 TY] Type mismatch using array and DDL
    By futurespec in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 07-02-2012, 09:34 AM
  2. Type Mismatch: array or user defined type expected
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 10:45 AM
  3. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:54 AM
  4. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 12:30 AM
  5. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05: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