NumberToText Method

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

Syntax

object.NumberToText( bIntegersFixedWidth, WidthToUse, bLeadingZeros )

 

Parameter Type Default Description
bIntegersFixedWidth Boolean True optional, this parameter specifies whether the number should be changed into a fixed width string.
WidthToUse Long 5 optional, this specifies the width while converting the number into a fixed width.
bLeadingZeros Boolean True optional, this specifies whether the leading zeros will be padded,  while converting the number into a fixed width.

 

Example 1

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

 

 'Specify the worksheet range as Columns A through C

  Dim WksRange as Object

  Set WksRange = Worksheet.Columns(1,3)

 

 'Convert the cells to text

  WksRange.NumberToText(True, 2, False)

 

 

Used by: WksRange Object