Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tonya
 
Posts: n/a
Default Remove line break within cell

I have a document that was provided to me which I have to make some changes
to and save as a text file for importing into a database. However, there are
breaks after each line signified by a small square. I want to remove all
those breaks because when saving as a txt file, it thinks it is a real break.
How can I remove those crazy little squares.

  #2   Report Post  
Barb R.
 
Posts: n/a
Default

You may need the drawing toolbar to select them.
Right click in any toolbar and select Drawing.
Right click in a toolbar and select CUSTOMIZE, Categories DRAWING,
Drag the "Select multiple objects" command to the drawing toolbar.
Click on CLOSE.
Click on the Select Multiple Objects tool and choose the objects you want to
delete.

Come back if that doesn't work.

"Tonya" wrote:

I have a document that was provided to me which I have to make some changes
to and save as a text file for importing into a database. However, there are
breaks after each line signified by a small square. I want to remove all
those breaks because when saving as a txt file, it thinks it is a real break.
How can I remove those crazy little squares.

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

You can use Chip Pearson's Cell View addin to find out the character it is:
http://www.cpearson.com/excel/CellView.htm

If those box characters are char(10)'s (alt-enters), you can use
edit|Replace
what: ctrl-j
with: (spacebar??)
replace all

If that box character is something else, you may need a macro:

Option Explicit
Sub cleanEmUp()

Dim myBadChars As Variant
Dim myGoodChars As Variant
Dim iCtr As Long

myBadChars = Array(Chr(13)) '<--What showed up in CellView?

myGoodChars = Array(" ")

If UBound(myGoodChars) < UBound(myBadChars) Then
MsgBox "Design error!"
Exit Sub
End If

For iCtr = LBound(myBadChars) To UBound(myBadChars)
ActiveSheet.Cells.Replace What:=myBadChars(iCtr), _
Replacement:=myGoodChars(iCtr), _
LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
Next iCtr

End Sub

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

Tonya wrote:

I have a document that was provided to me which I have to make some changes
to and save as a text file for importing into a database. However, there are
breaks after each line signified by a small square. I want to remove all
those breaks because when saving as a txt file, it thinks it is a real break.
How can I remove those crazy little squares.


--

Dave Peterson
  #4   Report Post  
Tonya
 
Posts: n/a
Default

Thank you, thank you, thank you! The macro worked it was 13 :)

"Dave Peterson" wrote:

You can use Chip Pearson's Cell View addin to find out the character it is:
http://www.cpearson.com/excel/CellView.htm

If those box characters are char(10)'s (alt-enters), you can use
edit|Replace
what: ctrl-j
with: (spacebar??)
replace all

If that box character is something else, you may need a macro:

Option Explicit
Sub cleanEmUp()

Dim myBadChars As Variant
Dim myGoodChars As Variant
Dim iCtr As Long

myBadChars = Array(Chr(13)) '<--What showed up in CellView?

myGoodChars = Array(" ")

If UBound(myGoodChars) < UBound(myBadChars) Then
MsgBox "Design error!"
Exit Sub
End If

For iCtr = LBound(myBadChars) To UBound(myBadChars)
ActiveSheet.Cells.Replace What:=myBadChars(iCtr), _
Replacement:=myGoodChars(iCtr), _
LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=False
Next iCtr

End Sub

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

Tonya wrote:

I have a document that was provided to me which I have to make some changes
to and save as a text file for importing into a database. However, there are
breaks after each line signified by a small square. I want to remove all
those breaks because when saving as a txt file, it thinks it is a real break.
How can I remove those crazy little squares.


--

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
how do I enter more than one line in the same Excel Cell by using. vsimmons Excel Discussion (Misc queries) 12 January 3rd 09 01:04 AM
How to remove an extra line added by excel when pasting into notep CoolGuy Excel Discussion (Misc queries) 1 March 2nd 05 02:57 PM
How can I strip a new line /nl in a cell in Excel globally Joe Excel Worksheet Functions 1 February 10th 05 07:29 PM
remove bold from cell ref headers Angiew Excel Discussion (Misc queries) 1 January 22nd 05 01:09 AM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM


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