+ Reply to Thread
Results 1 to 7 of 7

Date Confusion

  1. #1
    Forum Contributor
    Join Date
    09-12-2021
    Location
    Mexico
    MS-Off Ver
    Office 2019
    Posts
    169

    Date Confusion

    I have 2 macros operating on the same data, as shown on attached BookX on 2 separate, unlinked workbooks. The first macro contains the line

    Please Login or Register  to view this content.
    The second contains the line

    Please Login or Register  to view this content.
    They are clearly identical. The first one runs perfectly on the first workbook. The second gives the "Type mismatch error" at that line, for the second workbook's identical data.

    Any idea how to remedy? All help appreciated, the problem is really confounding.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,909

    Re: Date Confusion

    There is no code in your workbook
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    09-12-2021
    Location
    Mexico
    MS-Off Ver
    Office 2019
    Posts
    169

    Re: Date Confusion

    I have attached the workbook containing the code. I'm find that apparently the other 3 conditions somehow interfere with the date condition. Separating it from the rest appears to help
    Thanks.
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,909

    Re: Date Confusion

    Has this been solved based upon your last post?

  5. #5
    Forum Contributor
    Join Date
    09-12-2021
    Location
    Mexico
    MS-Off Ver
    Office 2019
    Posts
    169

    Re: Date Confusion

    I'm afraid not. I thought that separating the date condition from the other 3 might work. It doesn't appear to work. The problem is the presence of the date condition. The other 3 work fine.

    Any ideas for a workaround are greatly appreciated.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,909

    Re: Date Confusion

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

  7. #7
    Forum Contributor
    Join Date
    09-12-2021
    Location
    Mexico
    MS-Off Ver
    Office 2019
    Posts
    169

    Re: Date Confusion

    Many thanks. I did 2 similar things:

    1.- I kept the first 3 conditions together as an OR statement.
    2.- I inserted the 4th condition into a new line, just as you did, and change DateValue to CDate.

    It appears to have worked.

    I will also try yours, maybe it speeds up the macro. Importantly, can you think of any reason why this is the case? Maybe 4 conditions are not allowed in one OR line?

    As always you have been very helpful, thanks.

+ 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] =SUM Confusion
    By CynideHigh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2017, 02:41 PM
  2. [SOLVED] INDEX/IF/Date Range Formula Confusion
    By fearonc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2015, 02:53 AM
  3. Replies: 0
    Last Post: 06-30-2012, 04:00 AM
  4. Confusion with last row
    By LiLi1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-15-2011, 06:09 PM
  5. Complex IF and Date/Time Confusion
    By firehousetk in forum Excel General
    Replies: 3
    Last Post: 11-14-2011, 03:20 PM
  6. Conditional Confusion w/date functions
    By maloneyman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-08-2011, 02:57 AM
  7. Date vs h:mm:ss confusion
    By Barry in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 11-07-2005, 08:40 PM

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