+ Reply to Thread
Results 1 to 4 of 4

Type mismatch error

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

    Type mismatch error

    I have a macro (see enclosed). Basically, on sheet1 in col-G i list the sheets thare in the file. For each sheet in the file i am going to find the date col and then starting at the bottom of the col work my way up looking for similar month and year.

    problem is that it goes through the for/next the first time abut when it gets to the 2nd time it has a problem.

    any ideas..........error code is type mismatch..........but i don know
    Attached Files Attached Files
    Last edited by welchs101; 07-13-2011 at 02:02 PM.

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

    Re: Type mismatch error

    ok, figured it out.

    On the 3rd page "Test2" the last row is not a date but rather its "AVG". So when i do this

    Month("Avg") it has a type mismatch error.

    question: I want to allow this error to occur but what is teh best way to test for it.....i know its something like onerror

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Type mismatch error

    I have no idea what you are trying to do

    But the error occurs here when you are trying to evaluate "avg" as a date

    Please Login or Register  to view this content.
    Try this instead.
    Please Login or Register  to view this content.

    Hope this helps.
    Last edited by Marcol; 07-13-2011 at 07:13 PM. Reason: typos
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

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

    Re: Type mismatch error

    Just what i needed..........thanks. I was looking up info on error statements and which one i wanted.

    This is much easier!!!!!!!!!!!!!!! thanks.

+ 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