I can't reproduce your problem. If it's important enough, you can create your own .csv save macro, using VBA's file handling commands. Then you can apply whatever formatting you'd like. But first I would describe the details of your problem a little more, because the built-in capability really should be able to do this properly. Rob
This may or may not be related to a problem I reported some time ago (thread707-406809) where Excel would mysteriously (and temporarily) convert a chart axis date format to a four-digit year. Again, if it's important enough, there are ways around it. Rob
Basically that's what I am doing, the structure is in fact a bit more complex.
I have 3 files: 1 databook (main file), 1 template (yymmdd.xls) and 1 refresh file.
I use the refresh file that will open databook and close it, then open the template file which contains only links to the databook and then save that template to csv (and not alter the template)
Everything works perfect, except that my customer wants his date like (yymmdd), I can set the format in the databook or in the template but when I expotr to csv it goes to yyyymmdd (and not when I do it manualy)
This may sound trivial, but have you recorded the macro while doing it manually, to see if there is any difference, however small, between the generated code and your macro? Rob
If all else fails, you can use the following sub to create a duplicate sheet of just text values, export that, and delete the sheet afterwards.
Sub MakeTextSheet()
Dim Sh As Worksheet, cell As Range
Set Sh = ActiveSheet
ActiveSheet.Copy ActiveSheet
For Each cell In Sh.UsedRange
Range(cell.Address) = "'" & cell.Text
Next cell
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.