does not retain user-defined date format (YYYY) in Calc

asked 2018-02-05 18:56:43 +0100

dysonsphere gravatar image


Calc does not retain the user-defined date format YYYY.

I need to convert a date column into year for multiple spread sheets.

I recorded a macro which works great by copying the date column, pasting it in the next column and formatting it to date:YYYY.

There is no YYYY format in Calc by default, so I enter it in Format>cells... I click the green check and it shows up as 1999. All good. Until I close Calc.

On a new instance this format is lost and the year shows up as a number string. I am able to manually change it to YYYY, or enter the Format> cells dialogue and define YYYY before running the macro, but that defeats the purpose of the macro (saving time).

I tried saving a blank cell with the format YYYY defined as a template and setting the template to default, but still the formatting is missing.

I tried saving it as a style on the template, that too did not work.

Any thoughts on why YYYY can not be retained after closing Calc?

Why can't YYYY be a standard Calc date format?


edit retag flag offensive close merge delete


Setting the date with YYYY is only to view typing is a complete date dd/mm/yyy. right!

Gilberto Schiavinatto gravatar imageGilberto Schiavinatto ( 2018-02-06 01:19:47 +0100 )edit

"I need to convert a date column into year..." What about function YEAR()? What about Text to Columns with Fixed width?

JohnSUN gravatar imageJohnSUN ( 2018-02-06 14:38:58 +0100 )edit

Cell A1= 21/10/2016



Gilberto Schiavinatto gravatar imageGilberto Schiavinatto ( 2018-02-07 01:19:49 +0100 )edit