Number Format in Specified Range

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Number Format in Specified Range

Postby Nicholas » Tue Jan 18, 2011 3:15 am

I want to set different number format in the specified range from other cells, how can I do?
Posts: 9
Joined: Tue Dec 28, 2010 1:16 am

Re: Number Format in Specified Range

Postby iceblue support » Tue Jan 18, 2011 7:45 am

You may use following code to set the number format of the range:
sheet.Range[2, 2, 6, 6].NumberFormat = "$#,##0.00";
When you write numbers in the range, it will use the format you

specify, such as:
sheet.Range["C3"].NumberValue = 3240.689;
sheet.Range["D4"].NumberValue = 5230.123;
e-iceblue support
User avatar
iceblue support
Posts: 244
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests