NumberToText

The NumbertoText method is used to convert numeric cells to text cells.

Syntax

object.NumberToText( bIntegersFixedWidth, WidthToUse, bLeadingZeros )

Parameter

Type

Required/

Optional

Default

Description

bIntegersFixedWidth

Boolean

Optional

True

This parameter specifies whether the number should be changed into a fixed width string.

WidthToUse

Long

Optional

5

This specifies the width while converting the number into a fixed width.

bLeadingZeros

Boolean

Optional

True

This specifies whether the leading zeros will be padded, while converting the number into a fixed width.


Example

This example converts numbers in the worksheet range to text with a fixed width of 2 characters without padding the text with leading zeroes.

Dim SurferApp As Object

Set SurferApp = CreateObject("Surfer.Application")

SurferApp.Visible = True

 

'Open the worksheet document

Set Wks = SurferApp.Documents.Open(SurferApp.Path+"\samples\demogrid.dat")

 

'Specify the worksheet range to Columns A-B

Set WksRange = Wks.Columns(Col1:=1, Col2:=2)

WksRange.NumberToText(bIntegersFixedWidth:=True, WidthToUse:=2, bLeadingZeros:=False)

 

Used by: WksRange Object