Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default prevent converting numbers with hyphens to dates

I have a csv file that includes a column that contains text in the format
1-2-14. These are not dates, they are text and must remain in that format. I
have tried importing, pasting, everything I can think of (including the
obvious cell formatting) with no luck. They are converted into dates and I
can't get them back into the right format. Can anyone help?

Thanks in advance
Mike
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default prevent converting numbers with hyphens to dates

One way would be to do a Find$Replace on the file before importing to replace
all hyphens with doublehyphens.....(replace - with --)...........then change
back after importing if you wish..........


Vaya con Dios,
Chuck, CABGx3



"Mike" wrote:

I have a csv file that includes a column that contains text in the format
1-2-14. These are not dates, they are text and must remain in that format. I
have tried importing, pasting, everything I can think of (including the
obvious cell formatting) with no luck. They are converted into dates and I
can't get them back into the right format. Can anyone help?

Thanks in advance
Mike

  #3   Report Post  
Posted to microsoft.public.excel.misc
Anne Troy
 
Posts: n/a
Default prevent converting numbers with hyphens to dates

Well, I am not sure if this will help when it's already been imported:
http://vbaexpress.com/kb/getarticle.php?kb_id=138
************
Hope it helps!
Anne Troy
www.OfficeArticles.com

"Mike" wrote in message
...
I have a csv file that includes a column that contains text in the format
1-2-14. These are not dates, they are text and must remain in that format.
I
have tried importing, pasting, everything I can think of (including the
obvious cell formatting) with no luck. They are converted into dates and I
can't get them back into the right format. Can anyone help?

Thanks in advance
Mike



  #4   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default prevent converting numbers with hyphens to dates

Mike,
Since the data have already been converted, maybe you can try something
like:
=DAY(a1)&"-"&MONTH(A1)&"-"YEAR(A1)-1900)

Does this help?
Kostis Vezerides

  #5   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default prevent converting numbers with hyphens to dates

I should let you know that the csv file itself has not been converted. If I
open it in notepad, the data is still intact. I just can't seem to view or
manipulate it in Excel.

"Mike" wrote:

I have a csv file that includes a column that contains text in the format
1-2-14. These are not dates, they are text and must remain in that format. I
have tried importing, pasting, everything I can think of (including the
obvious cell formatting) with no luck. They are converted into dates and I
can't get them back into the right format. Can anyone help?

Thanks in advance
Mike



  #6   Report Post  
Posted to microsoft.public.excel.misc
Pete
 
Posts: n/a
Default prevent converting numbers with hyphens to dates

Rename the csv file to .txt, then in Excel do File | Open and point to
the .txt file. This will automatically take you into the File Import
Wizard, where you will be able to specify in the 3rd panel which
field(s) you want to import as text (or dates etc).

Hope this helps.

Pete

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting numbers to text gls858 New Users to Excel 2 October 18th 05 10:56 PM
Converting Formula answers to numbers pugsly8422 Excel Discussion (Misc queries) 3 September 9th 05 03:47 PM
Converting numbers to date format from csv files FiBee Excel Discussion (Misc queries) 1 January 12th 05 01:30 PM
converting dates into numbers help me Excel Discussion (Misc queries) 3 December 17th 04 03:11 AM
micosoft excel dates entered but changed to sequencial numbers ho. ten twenty Excel Worksheet Functions 1 December 10th 04 02:29 AM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"