Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Split text into 2 columns

Separate my data into two columns at the first Capital letter?

My data looks like this x 544 lines

aerodrome A defined area on land or water.
air cargo Freight, mail and express traffic transported by air.
airport An area of land or water that is used or intended to be used for
landing an aircraft.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Split text into 2 columns

Here is an example splittin col A into cols A & B:

Sub capSplit()
Dim v As String, s As String
Set r = Intersect(ActiveSheet.UsedRange, Range("A:A"))
For Each rr In r
v = rr.Value
For i = 1 To Len(v)
s = Mid(v, i, 1)
If Asc(s) 64 And Asc(s) < 91 Then
rr.Value = Left(v, i - 1)
rr.Offset(0, 1).Value = Mid(v, i)
Exit For
End If
Next
Next
End Sub
--
Gary''s Student - gsnu201001


"LeisaA" wrote:

Separate my data into two columns at the first Capital letter?

My data looks like this x 544 lines

aerodrome A defined area on land or water.
air cargo Freight, mail and express traffic transported by air.
airport An area of land or water that is used or intended to be used for
landing an aircraft.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Split text into 2 columns


THANK YOU!!!!!!!!!!!! :)

"Gary''s Student" wrote:

Here is an example splittin col A into cols A & B:

Sub capSplit()
Dim v As String, s As String
Set r = Intersect(ActiveSheet.UsedRange, Range("A:A"))
For Each rr In r
v = rr.Value
For i = 1 To Len(v)
s = Mid(v, i, 1)
If Asc(s) 64 And Asc(s) < 91 Then
rr.Value = Left(v, i - 1)
rr.Offset(0, 1).Value = Mid(v, i)
Exit For
End If
Next
Next
End Sub
--
Gary''s Student - gsnu201001


"LeisaA" wrote:

Separate my data into two columns at the first Capital letter?

My data looks like this x 544 lines

aerodrome A defined area on land or water.
air cargo Freight, mail and express traffic transported by air.
airport An area of land or water that is used or intended to be used for
landing an aircraft.

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
Split text into columns Mervyn Thomas[_2_] Excel Programming 1 December 22nd 09 06:23 PM
Split Text in a Cell (4 columns) Elton Law[_2_] Excel Programming 1 October 15th 09 04:59 PM
Identifying text to split into columns Cynthia Excel Worksheet Functions 7 November 14th 07 09:11 PM
Insert columns and split text mikebres Excel Programming 2 September 1st 07 07:58 AM
Text to columns, split at first space only Wowbagger New Users to Excel 3 April 21st 06 09:22 PM


All times are GMT +1. The time now is 09:53 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"