Saturday, April 14, 2012 2:22 PM
I am sending some data from a datagridview to a Excel sheet.
But I have a problem with Date's , in the datagridview is 05-12-2012
When i put it in a new excelsheet it is 05-12-2012 00:00
I found something for changing the format of Date in a Excel cel
.Columns("H:H").NumberFormat = "dd/mm/yyyy"
But this is what i see then in Excel 05-12-yyyy ????? yyyy and not 2012
.Columns("H:H").NumberFormat = "dd/mm"
Then it works ??? 05-12
But I need , 05-12-2012 What do I put after NumberFormat ????
I want to do it by code and not in the Excel sheet
- Edited by KeesBlunder Saturday, April 14, 2012 2:22 PM
Saturday, April 14, 2012 9:42 PM
Maybe this link is useful. http://support.microsoft.com/kb/922069
If you use "dd/mm/yyyy" for a format string, what should happen when you pass it this string, "05-12-2012"? Aren't hose are different formats?
Mark the best replies as answers. "Fooling computers since 1971."
- Marked As Answer by KeesBlunder Sunday, April 15, 2012 11:41 AM
Sunday, April 15, 2012 11:41 AM
This is it , thanks for the link.
.Columns("H:H").NumberFormat = "dd/mm/jjjj"