Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Toby Stevenson
 
Posts: n/a
Default Removing Carriage Returns in Excel 2000

Hi There. I'm trying to automatically remove carriage returns from an Excel
2000 Spreadsheet. I've tried the holddown alt and type 0010 or 0013 in the
find and replace, but without success.

Any advice would be greatly appreciated.

Thanks
  #3   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

Are you sure they are carriage returns?

=FIND(CHAR(10),A1)

or

=FIND(CHAR(13),A1)

if both formulas return an error then there must be something else

If you get a number then the replace must be done incorrectly make sure that
match entire cell contents is not checked under options and type either 010
or 0010
However, I have noticed sometimes that excel can't find a character that I
know is there and then if I close Excel, start again it will work

regards,

Peo Sjoblom


"Toby Stevenson" wrote:

Hi There. I'm trying to automatically remove carriage returns from an Excel
2000 Spreadsheet. I've tried the holddown alt and type 0010 or 0013 in the
find and replace, but without success.

Any advice would be greatly appreciated.

Thanks

  #4   Report Post  
Toby Stevenson
 
Posts: n/a
Default

Hi Peo,

Yes I am sure they are carriage returns. =Find(CHAR(10)|G5) return a value
of 8. (| character is currently my list separator)

The problem with using alt 0010 was an artifact of using my laptop keyboard
which doesn't have a separate number pad, I hooked up an external keyboard
and that solved the problem, but lead to another one. I am now receiving an
error while trying to do this replace:

"Formula is too long"

Toby

"Peo Sjoblom" wrote:

Are you sure they are carriage returns?

=FIND(CHAR(10),A1)

or

=FIND(CHAR(13),A1)

if both formulas return an error then there must be something else

If you get a number then the replace must be done incorrectly make sure that
match entire cell contents is not checked under options and type either 010
or 0010
However, I have noticed sometimes that excel can't find a character that I
know is there and then if I close Excel, start again it will work

regards,

Peo Sjoblom

  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

That alt-0010 is used to force a new line within the cell.

If you're seeing a little box instead of seeing a new line, you could select
your cell(s) and do:

Format|Cells|Alignment tab|check the wrap text box.

If you really want to get rid of those alt-enters, here's a macro (saved and
modified from a previous post):


Option Explicit
Sub testme01()

Dim FoundCell As Range
Dim ConstCells As Range
Dim BeforeStr As String
Dim AfterStr As String

BeforeStr = chr(10)
AfterStr = " " 'space character???

With ActiveSheet
Set ConstCells = Nothing
On Error Resume Next
Set ConstCells = .Cells.SpecialCells(xlCellTypeConstants, _
xlTextValues)
On Error GoTo 0

If ConstCells Is Nothing Then
MsgBox "Select some cells in the used range"
Exit Sub
End If

With ConstCells
'get as many as we can in one step
.Replace what:=BeforeStr, Replacement:=BeforeStr, _
lookat:=xlPart, SearchOrder:=xlByRows

Do
Set FoundCell = .Cells.Find(what:=BeforeStr, _
after:=.Cells(1), _
LookIn:=xlValues, _
lookat:=xlPart, _
SearchOrder:=xlByRows, _
searchdirection:=xlNext, _
MatchCase:=False)

If FoundCell Is Nothing Then
'done, get out!
Exit Do
End If
FoundCell.Value _
= Replace(FoundCell.Value, BeforeStr, AfterStr)
Loop
End With
End With

End Sub

If you're using xl97, change that Replace( to application.substitute(

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Toby Stevenson wrote:

Hi Peo,

Yes I am sure they are carriage returns. =Find(CHAR(10)|G5) return a value
of 8. (| character is currently my list separator)

The problem with using alt 0010 was an artifact of using my laptop keyboard
which doesn't have a separate number pad, I hooked up an external keyboard
and that solved the problem, but lead to another one. I am now receiving an
error while trying to do this replace:

"Formula is too long"

Toby

"Peo Sjoblom" wrote:

Are you sure they are carriage returns?

=FIND(CHAR(10),A1)

or

=FIND(CHAR(13),A1)

if both formulas return an error then there must be something else

If you get a number then the replace must be done incorrectly make sure that
match entire cell contents is not checked under options and type either 010
or 0010
However, I have noticed sometimes that excel can't find a character that I
know is there and then if I close Excel, start again it will work

regards,

Peo Sjoblom


--

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
VBA for Excel 2000 file is corrupt nkamp Excel Discussion (Misc queries) 0 May 26th 05 03:37 PM
How can I prevent Excel 2000 from inserting hyperlinks? RJL Jr. Setting up and Configuration of Excel 1 May 20th 05 12:15 PM
other systems detecting excel 4.0 if excel 2000 is installed Tristan_Flynn Setting up and Configuration of Excel 0 January 18th 05 06:55 PM
pivotcell object to excel 2000 Kellyc Excel Discussion (Misc queries) 0 December 1st 04 03:45 PM
Statistical Excel Function Question within Excel 2000... Drew H Excel Worksheet Functions 3 October 31st 04 06:55 PM


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