View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Set Cell.Value to the Formated value

I'm not sure where the problem lies. You need to open the CSV file with a
text editor (not excel) like using NotePad and check to see the way the data
was saved. Then you can determine the correct way of fixing the problem.

CSV contains no formating, the data is just text with each column seperated
by a comma. Here are some typical solutions

1) If the data was not saved properly then write a macro to save the datz in
the correct format. This is pretty simple.
2) If the data was save properly then change the extension of the file from
CSV to TXT. when a TXT file is opened with excel a pop up Wizard will appear
that lets you select options. Choose Delimited and set the delimiter
character to "Comma" then you can c hoose how each column is formated using
the wizard selections.
3) If the data was save properly then after the file is opened reformat the
column the way you need.
4) Use a templet with the columns formated the way you want. Open the
templet then open the CSV file using the templet.
"Captain Nemo" wrote:

Hi All -

Simple one I think, but I can't connect the dots.

Cell.value is a date with custom number formatting. File is saved off
to tab delimited text.

When reopened in Excel, Excel default formats the dates, as the format
didn't stay with the file.

Not what I want. How to I get around it? I'm thinking I have to change
the date to a string and prepend an apostrophe.

But what I'm thinking ain't working.


Thanks in advance.

....best, Capt N.
--
Scream and Shout and Jump for Joy! I was here before Kilroy!

Sorry to spoil our little joke. I was here but my computer broke.

....Kilroy