This documentation is archived and is not being maintained.

Range.NumberFormat Property 

Returns or sets the format code for the object.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in

Dim range1 As Range

Dim returnValue As Object
returnValue = range1.NumberFormat

Dim sampleValue As Object
range1.NumberFormat = sampleValue

object NumberFormat {get; set;}
public System.Object get_NumberFormat();
public void set_NumberFormat(System.Object);
function get NumberFormat() : Object;
function set NumberFormat(Object);

This property returns Null if all cells in the specified range don't have the same number format.

The format code is the same string as the Format Codes option in the Format Cells dialog box. The Format function uses different format code strings than do the NumberFormat and NumberFormatLocal properties.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms