Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mike M.
 
Posts: n/a
Default How do I delete text to right of a comma in a range of cells?

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ian
 
Posts: n/a
Default How do I delete text to right of a comma in a range of cells?

Select the column with your data in and ensure that ythe next column is
empty.
Go to DataText 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
--
"Mike M." <Mike wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
JMay
 
Posts: n/a
Default How do I delete text to right of a comma in a range of cells?

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(",", c)
c.Value = Mid(c, 1, pos - 1)
Next c
End Sub

HTH,





"Ian" wrote in message
...
Select the column with your data in and ensure that ythe next column is empty.
Go to DataText 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
--
"Mike M." <Mike wrote in message
...
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





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
Why can't I Export selected cells to tab-delimited text file? JE McGimpsey Excel Discussion (Misc queries) 1 November 28th 05 05:33 PM
Select Range of Cells programmingrookie Excel Discussion (Misc queries) 2 August 11th 05 07:13 PM
Cells formated as text do not always display properly Cass Excel Discussion (Misc queries) 2 July 23rd 05 01:59 AM
monitoring a changing range of cells kevin Excel Discussion (Misc queries) 1 June 3rd 05 05:39 PM
monitoring a changing range of cells Kevin Excel Worksheet Functions 1 June 3rd 05 04:54 PM


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