View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Split astring using Capital letter as identifier

Try the below UDF

'Usage
=SplitWords(A1)

Function SplitWords(strData) As String
Dim intTemp As Integer
SplitWords = Left(strData, 1)
For intTemp = 2 To Len(Trim(strData))
If Mid(strData, intTemp, 1) = UCase(Mid(strData, _
intTemp, 1)) Then SplitWords = SplitWords & " "
SplitWords = SplitWords & Mid(strData, intTemp, 1)
Next
End Function

If this post helps click Yes
---------------
Jacob Skaria


"Raj" wrote:

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