![]() |
REMOVE EMPTY LINES IN EXCEL CELL
I need to remove the empty lines from individual cells (not remove entire rows)
----- ROW1 ----- to ----- ROW1 ----- |
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 ----- |
All times are GMT +1. The time now is 08:43 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com