+ Reply to Thread
Results 1 to 6 of 6

Array of dates when tested shows no dates ......but there are dates

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

    Array of dates when tested shows no dates ......but there are dates

    Hi,

    I have a column of dates. I define a variant array to acquire this column of dates.

    Then what i do is i test each entry in the array to see what entries are in fact dates.

    To my surprise none of the entries in the array pass as true for the "ISDATE" function.....

    Any ideas?

    note: enclosing file to show what i am talking about.
    Attached Files Attached Files
    Last edited by welchs101; 11-29-2012 at 12:45 PM.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Array of dates when tested shows no dates ......but there are dates

    He TarHeal,you need to change Value2 to just us Value. Value2 makes everything a string.
    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

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

    Re: Array of dates when tested shows no dates ......but there are dates

    huh.......that worked!

    I have to think about this for a second.

    .value2 does not convert everything to a string does it........the reason i ask is if you run the macro and then once the message box comes up press cntrl+break and then look at the contents of the array in the locals window.......what you see is that the date value of say 41103 is a data type of "double".......not string........but changing as suggested to .value instead of .value2 makes the 41103 a data type of "date"


    not sure why this is?

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

    Re: Array of dates when tested shows no dates ......but there are dates

    thanks mike......this would have cause me hours of work.....

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Array of dates when tested shows no dates ......but there are dates

    The HelpFile it says that the difference between .Value and
    ..Value2 is that the latter does not accept Currency or Date data types

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

    Re: Array of dates when tested shows no dates ......but there are dates

    hummmmmm.........again something i did not know..............

    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