Previous - xlsSetAlignment Section Home - Microsoft Excel Next - xlsInsertImg


xlsSetNumberFormat ( )

Sets the display formatting for the numbers in the range of selected cells. These formatting could be culture specific for comma and decimal. Percentages, dates could also be displayed.

Usage:

xlsSetNumberFormat (object me, string formatting )

Parameters:

formatting (string) - This string is in Excel's number formatting scheme. Some examples are:

Returns:

(integer) - The success code

Example:

xtRose = xtra("Rosetta").new( )
xtRose.xlsLaunch( )
xtRose.xlsNewBlank( )
xtRose.xlsSetRange( 1, 1, 5, 3 )
xtRose.xlsInsertTxt( [ ["a", "b", "c", "d", "e" ], [1, 2, 3, 4, 5 ], [1.1, 2.2, 3.3, 4.4, 5.5 ] ] )
xtRose.xlsSetRange( 1, 1, 5, 1 ) -- selects the first row for setting formatting
xtRose.xlsSetNumberFormat( "$#,##0.00;[Red]$#,##0.00" )

Notes:

http://xlsgen.arstdesign.com/core/numberformat.html has a great introduction on Excel's number formatting scheme.


Previous - xlsSetAlignment Section Home - Microsoft Excel Next - xlsInsertImg