Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

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?

Nicholas
 
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