' ******************************************************************* ' Thanks go to Éric Moreau for this one!! I renamed to PadL and made ' a small change to param order to allow optional padchar Now ' PADC,PADL,PADR works just like momma used to make :) Public Function PadR(ByVal pstrSource As String, _ ByVal pintLen As Integer, _ Optional ByVal pstrFiller As String = " ") As String PadR = Left$(Trim$(pstrSource) & String$(pintLen, pstrFiller), pintLen) End Function Public Function PadL(ByVal pstrSource As String, _ ByVal pintLen As Integer, _ Optional ByVal pstrFiller As String = " ") As String PadL = Right$(String$(pintLen, pstrFiller) & Trim$(pstrSource), pintLen) End Function Public Function PadC(ByVal pstrSource As String, _ ByVal pintLen As Integer, _ Optional ByVal pstrFiller As String = " ") As String ' Used pintLen - (pintLen - 2) and pintLen / 2 to allow non even values ' maintaining desired endlength as odd numbers would show up 1 character short PadC = Right$(String$(pintLen - (pintLen / 2), pstrFiller) & Trim$(pstrSource) _ & String$(pintLen \ 2, pstrFiller), pintLen) ' Debug.Print Len(PadC) ' Testing output End Function ' *******************************************************************
"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams