1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Public Function Capitalize(ByVal sText) if len(sText) > 0 and not isNull(sText) then dim arrText, index arrText = Split(sText, " ") for index = 0 to UBound(arrText) If Len(arrText(index)) > 0 Then arrText(index) = ucase(left(arrText(index), 1)) & right(arrText(index), len(arrText(index)) -1) end if next sText = Join(arrText, " ")
arrText = Split(sText, vbnewline) for index = 0 to UBound(arrText) If Len(arrText(index)) > 0 Then arrText(index) = ucase(left(arrText(index), 1)) & right(arrText(index), len(arrText(index)) -1) end if next sText = Join(arrText, vbnewline) end if Capitalize = sText End Function |