+ Reply to Thread
Results 1 to 8 of 8

Problem with "Type Mismatch" Run-time error 13

  1. #1
    Registered User
    Join Date
    11-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    56

    Problem with "Type Mismatch" Run-time error 13

    Hi guys

    I am trying to higlight rows that follow a specific criteria set by the user. I have tried this

    Please Login or Register  to view this content.
    Then I get a Type Mismatch error! What can be the problem?

    Best regards
    Danny

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Problem with "Type Mismatch" Run-time error 13

    par1 = "S70MC-C" that's a string. Not number.
    You can not compare "S70MC-C" with number.

    Same for par2 = "341C"

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with "Type Mismatch" Run-time error 13

    Ah okay..

    But how do I fix it then? Even changing Dim to String doesn't help?

    The error occurs in the If in the loop.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Problem with "Type Mismatch" Run-time error 13

    Don't think you can have "if Rows(i) = par1", you would need either a value or a range so you probably want:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with "Type Mismatch" Run-time error 13

    Thanks yudlugar.

    At least I got rid of the Type Mismatch error.

    But the code turns all the rows the specified color?!

    Can it be, so that it only turns the rows that meet the par1 and par2 criteria the specified color?

    Best regards..

  6. #6
    Registered User
    Join Date
    11-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with "Type Mismatch" Run-time error 13

    I solved it my self. It was only a missing "i".. The code enden up:

    Please Login or Register  to view this content.
    Thanks a lot..

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Problem with "Type Mismatch" Run-time error 13

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED",as per our Forum Rule #9. I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  8. #8
    Registered User
    Join Date
    11-08-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Problem with "Type Mismatch" Run-time error 13

    Hi Fotis!

    I have been looking for the "solved" button for ten minutes now. So thanks for your help..
    I have added to yudlugars reputation.. Don't worry..

    Best regards

+ 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. Excel 2010 (Run-time error '13' type mismatch) "Debug" and "Continue" Grayed out.
    By Jeronimo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2012, 06:42 PM
  2. [SOLVED] How to fix "Run-time error 13, type mismatch" when vlookup return value of #N/A?
    By ohlalayeah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2012, 02:01 AM
  3. [SOLVED] VBA Excel 2007 : Autofit Merge Cells Error "Run-time error '13': Type Mismatch"
    By Hudas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2012, 04:10 PM
  4. [SOLVED] Merged cells cause "Runtime error 13 type mismatch" problem
    By Ralph Malph in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2006, 08:55 AM
  5. Error Handling to mitigate "Run Time Erorr 13 Type Mismatch"
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2005, 09:05 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