LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Split astring using Capital letter as identifier

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find Capital Letter Boogie Excel Worksheet Functions 12 January 23rd 09 05:25 PM
changed to capital letter Dan Excel Discussion (Misc queries) 3 June 13th 08 06:24 AM
New Validation option to format 1st letter as Capital letter Jeff Excel Discussion (Misc queries) 5 July 13th 06 05:11 AM
Default Capital letter for 1st letter of a word Jeff Excel Discussion (Misc queries) 6 July 10th 06 08:36 AM
Turn to capital letter SBárbara Excel Discussion (Misc queries) 2 June 22nd 06 05:18 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"