format cell thru .net

How to format the Excel cell type into percentage type or custom type through .net?

[134 byte] By [Mahendiran] at [2008-2-27]
# 1

Hi Mahe,

Set the NumberFormat property of a Range object to the desired format code. For example, the following line changes the active cell so that it displays numbers as percentages (this/Me = Sheet1 in this example):

[C#]

this.Application.ActiveCell.NumberFormat = "0.00%";

[VB]

Me.Application.ActiveCell.NumberFormat = "0.00%"

Regards,

Steve

SteveHansen at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Visual Studio Tools for Office Orcas...

Visual Studio Orcas

Site Classified