+ Reply to Thread
Results 1 to 2 of 2

"Date" format after CSV import...

  1. #1
    Mike Iacovou
    Guest

    "Date" format after CSV import...

    Gethi all
    many thanks in anticipation.
    i am "importing" data from a CSV file by opening the CSV file in vba using
    GetOpenFilename. Once open, I am copy/pasting data from sheet(1) into
    previously active workbook into sheet(1), then closing the CSV file.
    The data imports OK, with the data in columns etc. What I have noticed is
    that the dates can be considered as "text" (ie left-aligned in cell) or
    "dates" (right-aligned). While IsDate() recognised both as dates, any date
    function / analysis does not correctly interpret the date in the former.
    If i select cell formatting and choose "date" etc, it doesn't make any
    difference to the cell. The only data option i have found to change the
    format is to use "text-to-columns" on that column... which itself can
    introduce some errors...
    i really need a way to debug the dates to ensure they are valid, and will be
    processed correctly.
    many thanks

    Mike

  2. #2
    Forum Contributor
    Join Date
    01-21-2005
    Location
    Colorado
    MS-Off Ver
    2000,2003,2007
    Posts
    481
    Have you tried setting the number format of the cells (or columns or rows) which contain your date data to one of the built in excel date formats such as vbShortDate or vbLongDate?

    FormatDateTime(cells(x,y), vbShortDate
    This may solve your problem

+ 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