+ Reply to Thread
Results 1 to 10 of 10

Sudden "Type mismatch error"

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Sudden "Type mismatch error"

    Hi all

    I've had a macro running on a shared spreadsheet for a few weeks now with no issues, but this morning it has decided to stop working and give me the "Run-time error '13': Type mismatch". I don't have much experience with macros and most of this macro was written by someone else so I don't know exactly what I'm doing.

    I've only attached the sheet with the macro in it as the rest of the spreadsheet contains confidential data...

    Here's what the macro is meant to do:

    Every time a cell in column A updates (based on a gigantic nested IF formula) then
    update column O with the value of column B
    update column C with the value of column A
    update column B with the current date

    Debugging the macro shows it gets stuck at

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I hope this makes sense, thanks
    Attached Files Attached Files
    Last edited by EdwardStephenson; 05-29-2014 at 05:27 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    Have you checked what's in the cells rngC and rngC.Offset(0,2) refer to?
    If posting code please use code tags, see here.

  3. #3
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Sudden "Type mismatch error"

    Error is because your IF formula resulting into error in cell A212. Modify IF formula not to result in error. You may use another nested IF or IFERROR formula.

  4. #4
    Registered User
    Join Date
    04-07-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Sudden "Type mismatch error"

    Yes haripopuri!!

    Thank you very much!

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Sudden "Type mismatch error"

    You are welcome. On a second look at your IF formula, why don't to use a table with possible values and apply a simple VLOOKUP or INDEX & MATCH formulas?

  6. #6
    Registered User
    Join Date
    04-07-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Sudden "Type mismatch error"

    But some of the possible values are ranges, for example (M6>=400,M6<=607). So how could I illustrate that in a table of possible values?

  7. #7
    Registered User
    Join Date
    04-07-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Sudden "Type mismatch error"

    Actually, I could just set the range lookup to true and include the range boundaries in the possible values table, couldn't I?

  8. #8
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Sudden "Type mismatch error"

    Nah, not that easy. Try the attachment if it works out for you.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-07-2014
    Location
    Berkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Sudden "Type mismatch error"

    Woah! Thanks for putting so much time in!! I would give you extra reputation if I could.

    I think I've managed to make it work though using vlookups... I simply include the lower bound (ignore upper bounds) for each "auto MI" value that has a range.
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Sudden "Type mismatch error"

    Perfect. Don't forget to keep the table sorted.

+ 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] 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
  3. Replies: 5
    Last Post: 08-08-2010, 03:03 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. [SOLVED] 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