Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Carriage Return

first, have you formatted the cells to wordwrap?

If you wordwrap the cells, Char(10)/vbLf will not appear as a box and will
cause a hard return

Char(13)/vbCr will show as a box and is not needed.

You can try selecting the cells and doing

Edit=Replace

Replace What : hold down the right alt key and using the numeric keypad
enter 0010

Replace With: leave this blank.

--
Regards,
Tom Ogilvy


"Lynn" wrote in message
...
I have a worksheet in which carriage and line returns show
as square characters. Does anyone have a macro that will
go through the worksheet and replace every instance with
vblf or vbCrLf.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Carriage Return

that should have been 0013 rather than 0010 for the replace what.

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
first, have you formatted the cells to wordwrap?

If you wordwrap the cells, Char(10)/vbLf will not appear as a box and will
cause a hard return

Char(13)/vbCr will show as a box and is not needed.

You can try selecting the cells and doing

Edit=Replace

Replace What : hold down the right alt key and using the numeric keypad
enter 0010

Replace With: leave this blank.

--
Regards,
Tom Ogilvy


"Lynn" wrote in message
...
I have a worksheet in which carriage and line returns show
as square characters. Does anyone have a macro that will
go through the worksheet and replace every instance with
vblf or vbCrLf.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Carriage Return

I've never had real good luck using alt-0013 in the Replace dialog. (alt-0010
work fine, though.)

I've always used an extra helper cell and a worksheet formula:
=substitute(a1,char(13),"")

or a macro:
Option Explicit
Sub testme()
With worksheets("sheet1")
.Cells.Replace What:=Chr(13), Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End With
End Sub

Tom Ogilvy wrote:

that should have been 0013 rather than 0010 for the replace what.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
first, have you formatted the cells to wordwrap?

If you wordwrap the cells, Char(10)/vbLf will not appear as a box and will
cause a hard return

Char(13)/vbCr will show as a box and is not needed.

You can try selecting the cells and doing

Edit=Replace

Replace What : hold down the right alt key and using the numeric keypad
enter 0010

Replace With: leave this blank.

--
Regards,
Tom Ogilvy


"Lynn" wrote in message
...
I have a worksheet in which carriage and line returns show
as square characters. Does anyone have a macro that will
go through the worksheet and replace every instance with
vblf or vbCrLf.





--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Carriage Return

Thanks, the macro was exactly what I was looking for with
a couple of modifications.

-----Original Message-----
I've never had real good luck using alt-0013 in the

Replace dialog. (alt-0010
work fine, though.)

I've always used an extra helper cell and a worksheet

formula:
=substitute(a1,char(13),"")

or a macro:
Option Explicit
Sub testme()
With worksheets("sheet1")
.Cells.Replace What:=Chr(13), Replacement:="",

LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End With
End Sub

Tom Ogilvy wrote:

that should have been 0013 rather than 0010 for the

replace what.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
first, have you formatted the cells to wordwrap?

If you wordwrap the cells, Char(10)/vbLf will not

appear as a box and will
cause a hard return

Char(13)/vbCr will show as a box and is not needed.

You can try selecting the cells and doing

Edit=Replace

Replace What : hold down the right alt key and using

the numeric keypad
enter 0010

Replace With: leave this blank.

--
Regards,
Tom Ogilvy


"Lynn" wrote in message
...
I have a worksheet in which carriage and line

returns show
as square characters. Does anyone have a macro

that will
go through the worksheet and replace every instance

with
vblf or vbCrLf.





--

Dave Peterson

.

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
Carriage return CWH Excel Discussion (Misc queries) 1 March 16th 10 01:54 PM
Carriage Return Freddo Excel Worksheet Functions 2 March 22nd 07 10:34 AM
Hiding carriage return Abe Excel Discussion (Misc queries) 1 February 20th 06 09:58 PM
Carriage return after last column Steve Excel Discussion (Misc queries) 3 December 28th 05 09:29 PM
Strip carriage return, add row adin Excel Worksheet Functions 18 April 26th 05 10:03 AM


All times are GMT +1. The time now is 08:27 AM.

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"