Function Illustrate Values Class

SequenceString

Return a string containing a sequence of numbers. The numbers are right justified and any empty spaces are filled with the character vFillChar.

Signature (Visual Basic / VBA)

Public Function SequenceString( _
      Optional ByVal vStart As Variant _
    , Optional ByVal VEND As Variant _
    , Optional ByVal vWidth As Variant _
    , Optional ByVal vFillChar As Variant _
    ) As Variant

Code Example

    SequenceString(1, 10, 2, "-") = " 1 2 3 4 5 6 7 8 910"
    SequenceString(6, 16, 2, " ") = " 6 7 8 910111213141516"
    SequenceString(6, 16, 2, "-") = "-6-7-8-910111213141516"

Parameters

Parameter Description
vStart The first number in the sequence. vStart defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number.
vEnd The last number in the sequence. vEnd defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number. Function returns an empty string if vStart is greater than vEnd.
vWidth The space allocated for each number within the result string. vWidth defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number. Function returns an empty string if vWidth is < 1 (less than one).
vFillChar The character used to fill any empty spaces within the result string. vFillChar defaults to the space character (" ") if it is missing, Null, an empty string, or cannot be fixed up to a String.