ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clear a Carriage Return from a String Value (https://www.excelbanter.com/excel-programming/273618-re-clear-carriage-return-string-value.html)

JS[_4_]

Clear a Carriage Return from a String Value
 
Hi,

The CLEAN worksheet function removes all non printable characters, try
something like this

Sub CarriageRtn()
Dim cell As Range
For Each cell In Selection
cell.Value = Application.WorksheetFunction.Clean(cell.Value)
Next cell

End Sub

Select the problem cells and run the macro




All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com