Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You might need to expand your test... just testing for <91 makes your code
treat most punctuation marks and digits as if they were upper case letters. Think names like (FOX News host) BillO'Reilly or (when she was married to Lee Majors) FarrahFawcett-Majors. Just as an aside, concatenating *each* letter to make the string value is not as efficient as just handling the concatenations at the required break points (see the other posting in this thread for examples). If the UDF is to be used a great many times in the OP's spreadsheet, the extra overhead in your method might begin to show up as a slower spreadsheet recalculations. -- Rick (MVP - Excel) "Stefi" wrote in message ... Try this UDF: Function splitcap(wholestr) splitstr = "" For i = 1 To Len(wholestr) currchr = Mid(wholestr, i, 1) splitstr = splitstr & IIf(Asc(currchr) < 91 And i 1, " ", "") & currchr Next i splitcap = splitstr End Function Regards, Stefi Raj ezt *rta: Hi, I am looking for a formula/function/UDF that would split VasantRamPatil into Vasant Ram Patil ( ie split the string into three words using the capital letter as the initial letter of each word). The split can be either by inserting spaces inside the string itself or splitting the string into three strings). Thanks in advance for the Help. Regards, Raj |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find Capital Letter | Excel Worksheet Functions | |||
changed to capital letter | Excel Discussion (Misc queries) | |||
New Validation option to format 1st letter as Capital letter | Excel Discussion (Misc queries) | |||
Default Capital letter for 1st letter of a word | Excel Discussion (Misc queries) | |||
Turn to capital letter | Excel Discussion (Misc queries) |