Excel Number Format
We can use FormatString
property to format the display value of any Excel Cell
or Range
in C# with IronXL.
Using workSheet["A2"]
will only select Range
of the specified address. To access Cell
, the First()
method has to be used. However, FormatString
property can be set from both Cell
and Range
. Therefore, the First()
method can be taken out completely. More Excel number formats can be applied using the same method as the code example have shown.
You can download a file project from this link.
How to use Excel NumberFormat
in C#
- Download C# library to use Excel number format
- Load existing Excel file with
Load
method - Set
FormatString
property of a cell to specify number format - Select range of cells and modify the
FormatString
property in C# - Export the edited spreadsheet with
SaveAs
method.