+ Reply to Thread
Results 1 to 7 of 7

Maddening date format issues

  1. #1
    Forum Contributor
    Join Date
    10-10-2003
    Location
    Massachusetts
    MS-Off Ver
    Office 365
    Posts
    103

    Maddening date format issues

    We have two office computers that run the same .xlsb (not at the same time). Call them Computer A and Computer B

    Example of issue:

    Cell A6 contains a date. For the sake of discussion it displays 06/18/24 in A6 on the sheet.

    If we open the sheet on Computer A, click on cell A6 and look at the formula bar, it displays 06/18/2024. Computer B displays 6/18/2024. Computer B drops the leading 0 when you look at the fomula bar. The cell on the sheet always shows the 0 when using either computer.

    We use the date in VBA to create a file name. We need to create a file name in MMDDYY format.

    Example:
    Please Login or Register  to view this content.

    The variable strFile needs to contain: 061824.pdf

    The dropped zero causes issues with the code.


    Computer B will not create the file - it drops the 0 from the month.

    Both computers use the same workbook at different times during the day.

    Why is Computer B dropping the leading 0 from 06/18/24 when you look at while computer A does not.
    As always, any help is greatly appreciated.

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Maddening date format issues

    This could be a Windows setting rather than specifically to do with Excel. If you click on Control Panel, then Time & Language you can navigate to several panels where you can set the Short Date format - ensure this is the same on both machines.

    Hope this helps.

    Pete

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,242

    Re: Maddening date format issues

    This doesn't look right to me:
    Please Login or Register  to view this content.
    I'm not in a position to test it, but shouldn’t it be like this:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    10-10-2003
    Location
    Massachusetts
    MS-Off Ver
    Office 365
    Posts
    103

    Re: Maddening date format issues

    Pete_UK is spot on!!!!!!!!!!

    After dinner tonight I fired up excel on my home computer.
    Formatted A1 as date MMDDYY
    Entered 06/18/24 into A1.
    Sure enough the formula bar displayed 6/18/2024

    As per Pete's suggestin, navigated to the date and time format settings for Windows. Swithched the format to MMDDYY.

    Instantly the formula bar changed to 06/18/2024. No idea why the format for the year is still 4 digits. As long as we can take the left, middle and right of the cell to make the file name, we're psyched.

    Thanks to all that have taken the time to look and respond!!!!!!!!!!!!!!!!!!!!!!

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: Maddening date format issues

    Glad to help - thanks for the rep.

    I just noticed your Join Date of 2003. You must have been one of the earliest members to join the forum.

    Pete

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,242

    Re: Maddening date format issues

    @Pete: 1,473 out of 1,355,638 members. He appears on page 50 of the members' list.

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,980

    Re: Maddening date format issues

    Couldn't you just use:

    Please Login or Register  to view this content.
    rather than messing about with regional settings?
    Everyone who confuses correlation and causation ends up dead.

+ 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. Date format issues
    By SwissGoat in forum Excel General
    Replies: 9
    Last Post: 10-30-2020, 02:57 AM
  2. Date format issues
    By Vihral in forum Excel General
    Replies: 2
    Last Post: 03-06-2019, 03:36 AM
  3. Date Format Issues in Excel for Mac
    By the_edje in forum Excel General
    Replies: 2
    Last Post: 11-16-2018, 08:00 AM
  4. [SOLVED] Date format from textbox to filter - text to date formate issues
    By Wales MB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-26-2015, 07:36 AM
  5. Date format issues
    By robertrocks in forum Excel General
    Replies: 2
    Last Post: 11-05-2010, 01:32 PM
  6. Date format issues
    By sketchgal in forum Excel General
    Replies: 2
    Last Post: 07-20-2010, 07:33 AM
  7. date format issues
    By freekrill in forum Excel General
    Replies: 2
    Last Post: 02-16-2005, 07:52 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