At 16:27 24/07/2007 -0400, Jerry Feldman wrote:
I have an application that requires dates in yyyy-mm-dd format. I can
easily change the date format for individual cells, but is there a way
to globally tell calc to set the default date format to yyyy-mm-dd.
Additionally, is there a way to set the default decimal precision to a
specific number of digits. In this particular case I am working
with .csv files so to use calc, currently I must make the changes on a
per cell (or cell group) basis.

First, the easy bit: to change the number of fractional places displayed by Calc, go to Tools | Options... | OpenOffice.org Calc | Calculate | Decimal places.

I don't see any direct way to change the default date format, but here are a few workarounds:

o The default date format depends on the selected locale; it's just possible that you can find a locale in which your required date format is the default. Change locale at Tools | Options... | Language Settings | Languages.

o Rather than selecting areas here and there to be set to your required date format, it may be more convenient first to select a larger area and apply your preferred date format, and then to return parts of that area to Default format (or whatever).

o Cell format is a property of Calc's styles. If you create a style with your required date format, you can apply it to cells or areas of the spreadsheet using the Format Paintbrush. This could be easier and quicker.

o Are these CSV files in a standard layout? If you need to format a number of sheets or files in the *same* layout of formatting, there may be another way. Create an empty sheet but with the correct formatting applied to the right cells. Alternatively, just use a copy of an existing sheet. (You will have to keep this sheet as a proper spreadsheet (.ods) file, of course, not as a CSV file.) Import your data from the CSV file into another sheet, where it will appear, of course, without the required formatting. Now copy and paste the data into your formatted sheet, but - crucially - use Paste Special (Edit | Paste Special... or right-click | Paste Special... or Ctrl+Shift+V) instead of Paste. In the Paste Special dialogue box, remove the tick if necessary from "Paste all" and then also from "Formats". The paste function will then preserve the date format that you have already applied to your spreadsheet areas, rather than inheriting it from the pasted data (as default in this case).

I trust this helps.

Brian Barker


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to