Costas
Member
Hi,
I've got this excel table created through Jet reports and I've added a column at the far right. I'm now trying to insert the formula below but when I do that, it comes out as text. I've checked the format before running the code and it's "dd/mm/yy" and after I run the code it changes to text. Even when I manually change it back to the date format, the table still shows the formula as text. It's only when I press F2 and Enter that it converts to a date format.
So my question is in two parts:
a) How can I fix my code; and
b) Is there an easier way to change from text to date other than F2 and Enter? (BTY the little dot to convert from txt to number is not there)
Thanks
Costas
I've got this excel table created through Jet reports and I've added a column at the far right. I'm now trying to insert the formula below but when I do that, it comes out as text. I've checked the format before running the code and it's "dd/mm/yy" and after I run the code it changes to text. Even when I manually change it back to the date format, the table still shows the formula as text. It's only when I press F2 and Enter that it converts to a date format.
Code:
X = MyObject.ListColumns.Count
MyObject.HeaderRowRange.Cells(1, X + 1).Value = "MMM-YY"
MyObject.DataBodyRange.Columns(9).FormulaR1C1 = _
"=date(year([@[Date]]);month([@[Date]]);1)"
So my question is in two parts:
a) How can I fix my code; and
b) Is there an easier way to change from text to date other than F2 and Enter? (BTY the little dot to convert from txt to number is not there)
Thanks
Costas