View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
PeterAtherton PeterAtherton is offline
external usenet poster
 
Posts: 42
Default removing tabs from data

Peter
One way is to use a macro. Press Alt + F11 to open the VB Editor, choose
Insert, Module and copy the folling code.

Switch back to the sheet select all the lines to be altered (you might want
to try a few lines first or create a copy file and work with this)

Open the MAcro Window ALT + F8 or Tools, Macro and run the code
Sub clearReturns()
Dim str, c
For Each c In Selection
str = Replace(c, Chr(10), " ")
c.Value = str
Next
End Sub

Regards
Peter



"Peter Herman" wrote:

Hi there,
I have a column where the data is displaying on separate lines within each
cell. I would like the data to display on one line. As an example:

"Shed a little light in your office or study with this amazing dual table
lamp from Gregor, featuring florescent bulbs and an adaptive socket.
Stylish design, great in any room
Twin pole lamp
Innovative on/off pull chain design
Polished steel finish
White fabric shade"

All of this data is in one cell and I need it to be on one line within the
cell. The tabs are messing up a report that is running with tabs as the
delimeter as the report is adding each line as a separate delimeter column.
As I have 10,000 cells of data I do not want to have to go into each cell
manually. Is there a function or format I can use to remove the tabs and have
the data display as one line?
Thanks so much in advance,
Zev