+ Reply to Thread
Results 1 to 12 of 12

Type Mismatch on Superscript

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,083

    Type Mismatch on Superscript

    The code below has been in place for about a year, as part of a daily routine. This morning it started giving me a "Run-time error 13: Type Mismatch" on the line in red in the code below. I've attached the worksheet the macro works on, but I can't understand why it's giving an error. Your help is appreciated.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Type Mismatch on Superscript

    It is deffinitly not liking this in Range("E115")

    Please Login or Register  to view this content.
    Why not do something like this , as it does not seem to do anything with that row anyway?

    Please Login or Register  to view this content.
    Last edited by JapanDave; 06-27-2012 at 10:37 AM.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,083

    Re: Type Mismatch on Superscript

    Thanks JapanDave.

    I wondered if that Value error was the cause of my problem. I'll need to research and see where that came from.

    The error handling I'll use (should have had it in to begin with), but the screen updating is already being handled in the main macro; this is just one of about 30 sub-macros.

    Thanks for the fix.

    John

  4. #4
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Type Mismatch on Superscript

    Yes it seems that those cells with #VALUE! are the culprits. Have they been there before?

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Type Mismatch on Superscript

    You could consider using Excel's builtin facilities

    Please Login or Register  to view this content.



  6. #6
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,083

    Re: Type Mismatch on Superscript

    Looks like my initial problem was a red herring. The problem IS the #VALUE! errors. These recently appeared, because I changed this piece of code
    Please Login or Register  to view this content.
    for this piece of code:
    Please Login or Register  to view this content.
    (see the post at http://www.excelforum.com/excel-prog...a-values.html; I THOUGHT this was solved. Basically all I wanted to do was to fill the blanks in column X with values from column D)

  7. #7
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Type Mismatch on Superscript

    Glad that things are sorted out now.

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,083

    Re: Type Mismatch on Superscript

    Me too. BTW, looks like the link I posted was bad, so here it is again: http://www.excelforum.com/excel-prog...la-values.html

    For right now I'm going back to my old method, but if anyone wants to help me get the evaluate method to work without producing Value errors I'd appreciate it.

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Type Mismatch on Superscript

    But what about this ?

  10. #10
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,083

    Re: Type Mismatch on Superscript

    SNB,

    The link you posted takes me right back to here.

  11. #11
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Type Mismatch on Superscript

    Have you tried Snb's code to see if the same error occurs? I think that is why he has linked you to that post.

  12. #12
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,083

    Re: Type Mismatch on Superscript

    Thanks JapanDave. No, I hadn't tried SNB's code, because it was a solution to a problem that's not really a problem. My original code was failing due to Value errors in the data. I thought the problem was with the code that was failing, but my real problem was with the code that was producing the Value errors. Now that I've resolved THAT problem, I'll try SNBs code as a substitute for my original code and see if I notice any benefit. SNB's code is certainly more compact.

+ 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