Function DoLeftTrim(origstr as String, strlim as Integer, dospacetrim as Integer) as String ' origstr - string to check ' strlim - allowed length limit of string ' dospacetrim - 1 to do trim$ of whitespace Dim strlen as Integer ' length of origstr DoLeftTrim = origstr If (origstr = "") Then Exit Function End If If (strlim < 1) Then Exit Function End If strlen = Len(origstr) If (strlen > strlim) Then ' trim down DoLeftTrim = Left$(origstr, strlim) End If ' trim whitespace If (dospacetrim = 1) Then DoLeftTrim = Trim$(DoLeftTrim) End If Exit Function End Function