Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default text to columns using capital letters

I had a bit of a look but couldn't find an answer to this question:

How do I go about separating text into columns using a capital letter as the
delimiter?

For example:

So 'JoshCraig' in A1 becomes 'Josh' in A1 and 'Craig' in B1.

The problem arises because my data doesn't have spaces between first and
last names.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default text to columns using capital letters

You have your work cut out for you. assume JoshCraig is in cell A5
Put the formula =lower(a5) in cell B5

Now you need to strip off each character 1 at a time - and convert to code
(=Code) Then you can compare corresponding character (J to j - these
will match which is why you need the =Code function). It can be done, but
it's not pretty so unless you have a lot of data, you might consider the
manual solution.


"Josh Craig" wrote:

I had a bit of a look but couldn't find an answer to this question:

How do I go about separating text into columns using a capital letter as the
delimiter?

For example:

So 'JoshCraig' in A1 becomes 'Josh' in A1 and 'Craig' in B1.

The problem arises because my data doesn't have spaces between first and
last names.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default text to columns using capital letters

Dear Craig

Please use the below function. Launch VBE using Alt+F11. Insert a Module.
Paste the below code and save. Get back to worksheet. Select this function
under UserDefinedFunction.

=SplitTextbyCase(A1)

Function SplitTextbyCase(strText)
Dim intTemp
Dim intLen
intTemp = 2
intLen = Len(strText)
Do
If Asc(Mid(strText, intTemp, 1)) < 97 And Asc(Mid(strText, intTemp, 1)) 64
Then
strText = Trim(Left(strText, intTemp - 1)) & " " & Trim(Mid(strText, intTemp))
intTemp = intTemp + 1
intLen = Len(strText)
End If
intTemp = intTemp + 1
Loop Until intTemp intLen
SplitTextbyCase = strText
End Function


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



Reply
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
how to change small letters to capital letters HOW TO CHANGE Excel Discussion (Misc queries) 4 May 30th 07 01:12 AM
how do i turn all letters into capital letters? KeithT Excel Discussion (Misc queries) 3 May 11th 07 02:13 PM
Text to Coloumns, by consecutive capital letters paperclip Excel Worksheet Functions 2 July 20th 06 12:38 PM
Capital Letters Only Simon Jefford Excel Discussion (Misc queries) 2 February 2nd 06 06:04 PM
Capital Letters Gaute Excel Worksheet Functions 4 March 9th 05 09:55 AM


All times are GMT +1. The time now is 06:33 AM.

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

About Us

"It's about Microsoft Excel"