How to set the column format

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

How to set the column format

Postby dfense » Thu Oct 21, 2010 8:42 am

Hello!

How can i set the excel column format? For example from default to datetime, or specific datetime format: "dd.mm.yyyy hh:mm".

Thanks
dfense
 
Posts: 12
Joined: Tue Jan 20, 2009 2:35 pm
Location: Frankfurt, Germany

Re: How to set the column format

Postby Flash » Thu Oct 21, 2010 1:32 pm

Hello,

Thank you for your inquiry.
Please try to use following code to set column format.

Code: Select all
          sheet.Range["A1"].DateTimeValue = DateTime.Now;
          sheet.Columns[0].NumberFormat = "dd.mm.yyyy hh:mm";

Please let me know if you have any questions and concerns.

Best Regards.
User avatar
Flash
 
Posts: 56
Joined: Thu Jun 29, 2006 2:34 pm

Re: How to set the column format

Postby dfense » Thu Oct 21, 2010 1:53 pm

Great! It works very well. Thank you for support.

Best wishes.
dfense
 
Posts: 12
Joined: Tue Jan 20, 2009 2:35 pm
Location: Frankfurt, Germany


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests

cron