+ Reply to Thread
Results 1 to 4 of 4

Type Mismatch Errors Working WIth Date/Time

  1. #1
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Type Mismatch Errors Working WIth Date/Time

    Hello,

    I am having some difficulty with my code as it relates to dealing with dates. The problem I post here is part of a solution of an initial concept related question posted here. Although several have stepped to up to offer their solutions, no one has been able to answer my simple questions that has been hidden within the soultions given. The original question has been answerd, but I look for solutions to error created from within the solution.

    Consider this code:
    Please Login or Register  to view this content.
    The line in red is throwing a "Type mismatch" error. Before I declared 'eos' as a date, it was simply a variant and it passed. But with that, the line in purple threw a "Type mismatch" error.

    Looking for what I need to do to eliminate the error and get the results I'm needing.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: Type Mismatch Errors Working WIth Date/Time

    deleted....
    Last edited by protonLeah; 05-24-2020 at 05:00 PM.
    Ben Van Johnson

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Type Mismatch Errors Working WIth Date/Time

    Changing back to declaring eos as a Variant would get things moving again.

    Format returns a string, not a date. That's where the TypeMismatch is coming from.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Contributor
    Join Date
    06-15-2009
    Location
    Ontario, canada
    MS-Off Ver
    Office 365
    Posts
    371

    Re: Type Mismatch Errors Working WIth Date/Time

    Thank you Mike. Understanding now that formatting a value changes it to text helps overcome the initial error (in purple) that prompted me to switch my variant declaration to date. All good now!!!

+ 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. [SOLVED] Prompt for save If Then statement errors with Error 13 Type mismatch??
    By Destroy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2014, 10:42 PM
  2. [SOLVED] Sudden appearance of Run-time error '13': Type mismatch in previously working code
    By Rhudi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-22-2014, 11:30 PM
  3. [SOLVED] Time [type mismatch]
    By Neisany in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-10-2012, 01:53 PM
  4. Type Mismatch Errors...:Val() function
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2007, 04:01 PM
  5. Type Mismatch Errors...
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2007, 09:39 AM
  6. Type Mismatch Errors...
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2007, 09:32 AM
  7. run-time 13 Type mismatch
    By simonsmith in forum Excel General
    Replies: 2
    Last Post: 05-18-2006, 11:14 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