+ Reply to Thread
Results 1 to 5 of 5

Date displaying as something different than expected

  1. #1
    Registered User
    Join Date
    04-28-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2003
    Posts
    24

    Question Date displaying as something different than expected

    Why does this bit of code display a different to what I am seeing in the work sheet.

    Please Login or Register  to view this content.
    It displays the date 29/12/1899 whereas I am expecting 18/09/2011

    Appreciate any tips.
    Attached Files Attached Files
    Last edited by hattrick_123a; 09-21-2011 at 12:33 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Date displaying as something different than expected

    Hello,

    the "select" is the problem. Replace it with "value"

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Date displaying as something different than expected

    Hello hattrick123a,

    You can use this version of your macro to find the last date. In VBA it is rare to have to select an object before performing an operation.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    04-28-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2003
    Posts
    24

    Smile Re: Date displaying as something different than expected

    Thanks for this guys, both of these work.

    Please Login or Register  to view this content.
    Leith, this bit of code is a bit better. Can you jsut clarify what exactly it is doing?

    Specifically this part in red?

    Does it go to the very bottom of column A and then do a Ctrl+Up, which brings you to the top(i.e. the very last row with a date value in it)?

    Thanks Again

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Date displaying as something different than expected

    Hello hattrick_123a,

    Yes, it starts at the very bottom of the column and continues up until a cell with a formula or constant is found.

+ 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