Spire.XLS for .NET is a professional Excel .NET component that can be used to any type of .NET 2.0, 3.5, 4.0 or 4.5 framework application, both ASP.NET web sites and Windows Forms application.

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

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: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.XLS