My Blog List

hotinit.com. Powered by Blogger.

Search This Blog

Removing char(10) or Enter or Return in Excell Cells or Spreadsheet

Friday, 5 August 2011

Create a Macro, Put the below code and run it
  1. Copy above code.
  2. In Excel press Alt + F11 to enter the VBE.
  3. Press Ctrl + R to show the Project Explorer.
  4. Right-click desired file on left (in bold).
  5. Choose Insert -> Module.
  6. Paste code into the right pane.
  7. Press Alt + Q to close the VBE.
  8. Save workbook before any other changes.
Navigate to the worksheet on which you want to run the code, and hit Tools-->Macro, Macros, and double-click RemoveRtns.


Option Explicit  
Sub RemoveRtns()
Dim cel As Range 
For Each cel In ActiveSheet.UsedRange  
cel = Replace(cel, Chr(10), " ") 
Next 
End Sub









No comments:

Post a Comment

 

Blogger news

Blogroll

Most Reading

8.6/10