I have a long list of addresses and need to separate out the city and state,
which got merged all into one cell. Need to import data into Streets and
Trips and want to delete all city and state info out of the address cells.
Please assist.
Mike
Select the column with your data in and ensure that ythe next column is
empty.
Go to Datagt;Text to Columns and choose delimited, then comma.
Assuming your data is in column A you should get city in A and state in B.
--
Ian
--
quot;Mike M.quot; lt;Mike gt; wrote in message
...
gt;I have a long list of addresses and need to separate out the city and
gt;state,
gt; which got merged all into one cell. Need to import data into Streets and
gt; Trips and want to delete all city and state info out of the address cells.
gt; Please assist.
gt;
gt; Mike
Here's a simple example using VBA -- Assumes there are NO BLANK cells in your
Range..
Select (or Highlight) the range of cells (say B5:g20)
then run this macro: (you've placed in a standard module).
Sub RemoveText()
Set MyRange = Selection
For Each c In MyRange
pos = WorksheetFunction.Find(quot;,quot;, c)
c.Value = Mid(c, 1, pos - 1)
Next c
End Sub
HTH,quot;Ianquot; gt; wrote in message
...
gt; Select the column with your data in and ensure that ythe next column is empty.
gt; Go to Datagt;Text to Columns and choose delimited, then comma.
gt; Assuming your data is in column A you should get city in A and state in B.
gt; --
gt; Ian
gt; --
gt; quot;Mike M.quot; lt;Mike gt; wrote in message
gt; ...
gt;gt;I have a long list of addresses and need to separate out the city and state,
gt;gt; which got merged all into one cell. Need to import data into Streets and
gt;gt; Trips and want to delete all city and state info out of the address cells.
gt;gt; Please assist.
gt;gt;
gt;gt; Mike
gt;
gt;
- Aug 07 Thu 2008 20:45
How do I delete text to right of a comma in a range of cells?
close
全站熱搜
留言列表
發表留言