Function strPad(strSource, destLength, padChar, L_or_R) Dim srcLength srcLength = Len(strSource) If(srcLength >= destLength) Then strPad = strSource Else If(L_or_R = 0) Then strPad = String(destLength - srcLength, padChar) & strSource Else strPad = strSource & String(destLength - srcLength) End If End If End Function