Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
paperclip
 
Posts: n/a
Default Text to Coloumns, by consecutive capital letters


Is it possible to seperate a coloumn of data to individual coloumns by
using a delimiter of consecutive capital letters or where a capital
letter exists in a line of text:

eg. JohnSmith -- | John | Smith |

eg. LondonEngland -- | London | England |


--
paperclip
------------------------------------------------------------------------
paperclip's Profile: http://www.excelforum.com/member.php...o&userid=32219
View this thread: http://www.excelforum.com/showthread...hreadid=545417

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Text to Coloumns, by consecutive capital letters

I'm sure you could loop through each cell looking for upper case characters, but
I think I'd just bite the bullet and do 26 edit|replaces.

A -- |A
B -- |B
....
Z -- |Z

Using a macro would make it less painful:

Option Explicit
Sub testme()

Dim myRng As Range
Dim lCtr As Long

Set myRng = Worksheets("sheet1").Range("a:a")

For lCtr = Asc("A") To Asc("Z")
myRng.Replace what:=Chr(lCtr), _
replacement:="|" & Chr(lCtr), _
lookat:=xlPart, _
searchorder:=xlByRows, _
MatchCase:=True
Next lCtr

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Then you can run Data|Text to columns (and choose to ignore the first field???).



paperclip wrote:

Is it possible to seperate a coloumn of data to individual coloumns by
using a delimiter of consecutive capital letters or where a capital
letter exists in a line of text:

eg. JohnSmith -- | John | Smith |

eg. LondonEngland -- | London | England |

--
paperclip
------------------------------------------------------------------------
paperclip's Profile: http://www.excelforum.com/member.php...o&userid=32219
View this thread: http://www.excelforum.com/showthread...hreadid=545417


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Text to Coloumns, by consecutive capital letters


Thats not a bad idea at all Dave, many thanks.


Dave Peterson Wrote:
I'm sure you could loop through each cell looking for upper case
characters, but
I think I'd just bite the bullet and do 26 edit|replaces.

A -- |A
B -- |B
....
Z -- |Z

Using a macro would make it less painful:

Option Explicit
Sub testme()

Dim myRng As Range
Dim lCtr As Long

Set myRng = Worksheets("sheet1").Range("a:a")

For lCtr = Asc("A") To Asc("Z")
myRng.Replace what:=Chr(lCtr), _
replacement:="|" & Chr(lCtr), _
lookat:=xlPart, _
searchorder:=xlByRows, _
MatchCase:=True
Next lCtr

End Sub

If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Then you can run Data|Text to columns (and choose to ignore the first
field???).



paperclip wrote:

Is it possible to seperate a coloumn of data to individual coloumns

by
using a delimiter of consecutive capital letters or where a capital
letter exists in a line of text:

eg. JohnSmith -- | John | Smith |

eg. LondonEngland -- | London | England |

--
paperclip

------------------------------------------------------------------------
paperclip's Profile:

http://www.excelforum.com/member.php...o&userid=32219
View this thread:

http://www.excelforum.com/showthread...hreadid=545417

--

Dave Peterson



--
paperclip
------------------------------------------------------------------------
paperclip's Profile: http://www.excelforum.com/member.php...o&userid=32219
View this thread: http://www.excelforum.com/showthread...hreadid=545417

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
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
How do I change a column of cells to all capital letters? morpattyjo Excel Worksheet Functions 4 March 13th 05 07:59 PM
Capital Letters Gaute Excel Worksheet Functions 4 March 9th 05 09:55 AM
Auto change font to 'capital letters' Anthony Excel Worksheet Functions 3 February 12th 05 03:10 PM
How can I write in a text in a cell using numbers and the letters. Sandy Excel Discussion (Misc queries) 2 January 10th 05 11:49 PM


All times are GMT +1. The time now is 10:28 PM.

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"