View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default REMOVE EMPTY LINES IN EXCEL CELL

Try this

Option Explicit

Sub test()
Dim aWS As Excel.Worksheet
Dim r As Excel.Range
Dim myText As String
Set aWS = ActiveSheet

For Each r In aWS.UsedRange
myText = Right(r.Text, 1)
If myText = Chr(10) Then
r.Value = Left(r.Text, Len(r.Text) - 1)
End If

Next r
End Sub


HTH,
Barb Reinhardt


"steve r" wrote:

I need to remove the empty lines from individual cells (not remove entire rows)

-----
ROW1


-----

to

-----
ROW1
-----