Thread: Text to Columns
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Text to Columns

You could use this macro (just set the starting cell and column letters as
needed in the For Each statements Range reference)...

Sub SplitOnFirstDash()
Dim Cell As Range, Parts() As String
For Each Cell In Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)
Parts = Split(Cell.Value, "-", 2)
Cell.Offset(0, 1).Value = Trim(Parts(1))
Cell.Value = Trim(Parts(0))
Next
End Sub

--
Rick (MVP - Excel)


"LeisaA" wrote in message
...
500+ sentences, I need to seperate (text to columns) after the first "-"
only. There are subsequent "-" but I only want it seperated at the first.
And when I seperate it in the second column I do not want a space
preceeding
the text. Can you give advice on this, any help would be much
appreciated!
Thanks

Sample Data

AIR TAXI - An aircraft operator who conducts operations for hire or
compensation in accordance with FAR Part 135 in an aircraft with 30 or
fewer
passenger seats and a payload capacity of 7,500# or less. An air taxi
operates on an on-demand basis and does not meet the "flight scheduled"
qualifications of a commuter.
AIR TRAFFIC CONTROL (ATC) - A service operated by the appropriate
authority
to promote the safe, orderly, and expeditious flow of air traffic.
AIRPORT TRAFFIC CONTROL TOWER (ATCT) - A terminal facility that uses
air/ground communications, visual signaling, and other devices to provide
ATC
services to aircraft operating in the vicinity of an airport or on the
movement area. Authorizes aircraft to land or takeoff at the airport
controlled by the tower or to transit the Class D airspace area regardless
of
flight plan or weather conditions (IFR or VFR). A tower may also provide
approach control services (radar or non-radar).
ALCLAD - Trademark name of Alcoa for high-strength sheet aluminum clad
with
a layer (approximately 5.5% thickness per side) of high-purity aluminum,
popularly used in airplane manufacture.
ALPHABET (PHONETIC) - Devised for reasons of clarity in aviation voice
radio, this is the current NATO version in global use: