+ Reply to Thread
Results 1 to 5 of 5

Date formatting won't work

  1. #1
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Date formatting won't work

    Hi guys,

    I am having this unique issue with a worksheet which pulls data from a .csv file. The data contains dates and the formatting for the date column is set to "Short Date". But, when the data gets pulled, rather than getting something like "1/1/2021", I am getting "1/1/2021 12:00:00". The weird part is that it happens only in my Boss's computer, which is where they review the report that I make. We run the same version of Excel (2016). I tested the report on two other workstations in my office and it works just fine. I checked the Connection Properties and it is set to retain cell formatting while pulling data from .csv file.

    Am I missing something here or is there a specific setting in Excel which I need to change to fix this?

    Appreciate any help offered.

    Thanks

  2. #2
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Date formatting won't work

    To add another point, the excel file does not get moved around via email. It is stored in a central network location where anyone who has access to the folder can view and edit the file.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Date formatting won't work

    Any time you import a CSV file, excel often sees the contents as text...even numbers and dates (dates a really just numbers that excel formats to something we recognize as a date). No amount of formatting will change text to values, you have to physically make the change in the cell.

    If "1/1/2021 12:00:00" was an actual (real) date and not text looking like a date, the underlying value would be 44197.5....44197.5 days from 1900/1/0

    You could maybe use Text2Columns to convert to real dates?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: Date formatting won't work

    It could be your boss's computer short date setting:

    Short Date Settings.png

  5. #5
    Forum Contributor
    Join Date
    06-08-2021
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    101

    Re: Date formatting won't work

    FDibbins: Appreciate your inputs. I checked that but I don't think .csv import is causing this issue because it works fine in my computer. This issue is only with my Boss's computer. I tested this on several other computers and did not have the same issue. Also, the connection between the excel file and the .csv file is set to retain source formatting. I'm still not sure why the formatting is different.

    Josephteh: Thanks for your response. I checked this settings but it looks fine too.

    As a fix, I added a line to my VBA code to change the number format to display "mm/dd/yyyy". I would still appreciate any inputs to find out what is causing this issue in just one computer. I'm pretty sure I'm missing on some settings and I don't know where.

+ 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] Can't get overdue date conditional formatting to work
    By WarrenSA in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-09-2014, 10:33 AM
  2. [SOLVED] Date function, Need MM/YY *Note:Formatting will not work as sumproduct search
    By jenncess in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2013, 02:01 PM
  3. Replies: 1
    Last Post: 07-19-2012, 05:37 AM
  4. Having problem work on a date to work on 1 to 18 week
    By micope21 in forum Excel General
    Replies: 7
    Last Post: 01-15-2012, 05:41 PM
  5. Calculate START date based on duration (work hours) and END date
    By kaaver in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-06-2010, 12:21 PM
  6. Formatting from Text to Date ; doesnt work
    By babarorhum in forum Excel General
    Replies: 1
    Last Post: 09-18-2008, 10:50 AM
  7. [SOLVED] Date formatting won't work
    By Natman in forum Excel General
    Replies: 3
    Last Post: 08-19-2005, 02:05 PM

Tags for this Thread

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