Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete extra lines within same cell
Public Sub Test()
Dim cell As Range For Each cell In Selection If Not cell.HasFormula Then cell.Value = Replace(cell.Value, Chr(10), "") End If Next cell End Sub -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "FrankM" wrote in message ... This seems kindda odd to me but please stay with me. I have been given a spreadsheet I need to work with. One column has cells with multiple lines in the cell. Each line is separated by a carriage return. Sometimes there is three or four lines and sometimes there is five or six lines, all within the same cell. Some cells are empty or have just one line. I would like to eliminate everything after the first carriage return so each cell has a maximum of one line. I thought maybe this could be done in a Macro or in VB but I'm not certain. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert extra lines | Excel Discussion (Misc queries) | |||
To add extra line/lines to single cell in Excel spreadsheet | New Users to Excel | |||
How do I delete an extra space in every cell in a column? | Excel Discussion (Misc queries) | |||
Macro for Excel to add up items and delete extra lines? | Excel Programming | |||
?? Extra blank lines in 'address' cell after exporting to Excel | Excel Discussion (Misc queries) |