Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default REMOVE EMPTY LINES IN EXCEL CELL

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

-----
ROW1


-----

to

-----
ROW1
-----
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
-----

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
HOW DO I REMOVE/DELETE LINES IN EXCEL? George Brassington Excel Discussion (Misc queries) 2 July 29th 09 04:35 AM
How do I remove lines through text in excel cbroock Excel Discussion (Misc queries) 1 March 6th 08 06:44 PM
How to remove empty spaces in a cell with numbers? Tobias Excel Worksheet Functions 2 October 24th 07 02:08 PM
In excel, how do I remove unwanted lines for printing Darren N Excel Discussion (Misc queries) 1 October 2nd 06 01:41 PM
Remove empty rows in excel? Clbmgr Excel Discussion (Misc queries) 6 December 2nd 04 02:02 AM


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