smile

Function Rpad(ByVal MyValue$, ByVal MyPadCharacter$, ByVal MyPaddedLength%)
Dim x As Integer
Dim PadLength As Integer

Padlength = MyPaddedLength – Len(MyValue)
Dim PadString As String
For x = 1 To Padlength
PadString = MyPadCharacter & PadString
Next
Rpad = MyValue + PadString

End Function

Function lpad(ByVal MyValue$, ByVal MyPadCharacter$, ByVal MyPaddedLength%)
Dim x As Integer
Dim PadLength As Integer

PadLength = MyPaddedLength – Len(MyValue)
Dim PadString As String
For x = 1 To PadLength
PadString = PadString & MyPadCharacter
Next
lpad = MyValue + PadString

End Function