View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default International Date formatting

On Thu, 22 Nov 2012 09:28:42 -0800 (PST), Daniel wrote:

Hi,
I'm trying to add some days build a macro that adds days to a date
from an existing excel file.
However, the excel file may come from multiple sources and the way
they organize the date may come in different formats (dd/mm/yyyy or mm/
dd/yyyy). When I open the file in Excel (mine is configured to be mm/
dd/yyyy) it automatically assumes that format and the ones that do not
fit are changed to fit.

Is there a way for Excel to transform the date into its numerical
value before it changes the format independently of the format the
user used (and sometimes the date itself) so I can manipulate the
information?

Thanks in advance,

Daniel F. Uribe


You are leaving something out.

If the files you are importing are Excel files, with "real" dates, the nationality of the computer on which the file was created should not be an issue. It should already be there as a numerical value. There might be an issue, however, if some of the Excel files are using the 1904 date system.
However, if the files you are importing are text files, then you need to do the conversion using the "text to columns" or "text import" wizard.
If the file is a .txt file, opening it should bring up the text-to-columns wizard where there is a step at which you can specify the format of the date column.
If the file is a .csv file, you can either change it to a .txt file (merely by changing the suffix), or choose to "import" the file rather than open it, which should open the import wizard, giving the same functionality.

If the above does not help, please provide a more complete description of exactly what is going on.