+ Reply to Thread
Results 1 to 7 of 7

Mismatch error 13 out of the blue

  1. #1
    Registered User
    Join Date
    09-05-2010
    Location
    Massachusetts (USA)
    MS-Off Ver
    Excel 2007
    Posts
    44

    Question Mismatch error 13 out of the blue

    This macro I use to auto-create a report from raw data works fine for a while, but then, like today, for no reason that I can see, I get a mismatch error. The debugger points to a certain point in the code and I used my previous solutions to attempt a fix, but no matter what I do, the macro tanks.

    I have attached a sample copy of the raw data I use the macro on (macro is enabled/loaded already). It has to be something silly I'm overlooking. Any help is appreciated.
    Attached Files Attached Files
    Last edited by BlondOIverBlue; 06-19-2011 at 01:21 PM. Reason: Flagging as solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Mismatch error 13 out of the blue

    The code is crashing in this section on the line highlighted:

    Please Login or Register  to view this content.

    At the crash point, i=9, and:

    Please Login or Register  to view this content.

    So, you're trying to extract TimeValue("Start Time") which is why you get the Error 13 Type Mismatch

    I don't really follow the logic of the code (it's early and I'm not fully awake) but that's where it's at.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-05-2010
    Location
    Massachusetts (USA)
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Mismatch error 13 out of the blue

    Hrmmm....ok, I think I see what you mean, but I'm still a little puzzled why all week it worked flawlessly and tonight, this. I looked at that portion of the code and all "seems" to be in order.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Mismatch error 13 out of the blue

    I'm guessing it's because there's only one line of data at that point so the end(xlup) isn't giving you a block of data to make comparions with.

    If, for example, you had a second line of data and you started from row 10, you'd be selecting $L$6:$M$7. Maybe this is the first time you only have one row of data?


    Note that you can do this:

    Please Login or Register  to view this content.

    to convert the text numbers to real numbers instead of looping throgh the rows.

    Regards

  5. #5
    Registered User
    Join Date
    09-05-2010
    Location
    Massachusetts (USA)
    MS-Off Ver
    Excel 2007
    Posts
    44

    Question Re: Mismatch error 13 out of the blue

    Note that you can do this:

    Please Login or Register  to view this content.
    to convert the text numbers to real numbers instead of looping through the rows.
    Maybe I'm just not in the state of mind to look at code given it's two o'clock in the morning, but, while I get the gist of what you said, for some reason, I'm having issues using this code and testing it. I keep getting a compile error.

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

    Re: Mismatch error 13 out of the blue

    As TMShucks pointed out the error occurs when there is a single Tech ID row. The use of .End(xlUp) causes the returned range to include non valid data.
    This additional code will check for single row items.

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

  7. #7
    Registered User
    Join Date
    09-05-2010
    Location
    Massachusetts (USA)
    MS-Off Ver
    Excel 2007
    Posts
    44

    Lightbulb Re: Mismatch error 13 out of the blue

    After I got some sleep, I took another stab at this. Once I saw Andy Pope's reply, it all made more sense!

    When the error happened before, I just chalked it up as "not solvable" because I assumed that the raw output data I get from my database was the cause due to the intermittent nature of the error. I never thought it was the macro itself per sé. I can't believe for the last year I overlooked that. Thanks so much everyone!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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