LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default remove crlf

I am new to VBA. I need to select a column in the worksheet and remove all
carriage return/line feeds. I am using the following code I got off
different posts to this group. What happens is the loop runs forever. What
am I doing wrong?

Dim aCell As Range
Sub Remove_CR_LF()
For Each aCell In Selection
With Selection
.Replace What:=Chr(13) & Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End With
Next aCell
End Sub

 
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 get SQL data to show CRLF instead of question marks? Number2 Excel Discussion (Misc queries) 0 November 15th 09 05:15 AM
Making tab do a CRLF when reaching end of a range John A Excel Discussion (Misc queries) 3 May 10th 07 02:13 AM
Remove last CRLF in text file [email protected] Excel Programming 4 March 30th 07 08:52 AM
CRLF in .cvs file LMI Excel Programming 2 April 7th 06 02:31 PM
CRLF in text box Neil Miller[_2_] Excel Programming 5 January 7th 04 03:14 PM


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