View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

It depends on what those squares are.

If they're alt-enters (char(10)'s), then just formatting the cells for wraptext
will make them force new lines within the cell.

If they're something else, you may need a helper cell with a formula or even a
macro to get rid of them or even edit|replace...

If you want to try edit|replace...

If it's alt-enter, you can hit and hold the alt key while typing 0010 on the
numeric keypad (or even just hit ctrl-j).

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

Once you know what it is, you could try the alt-#### to see if it works.

If it doesn't, you could use a macro to change it to a different character (|
maybe???). Then use that character in the data|Text to columns. (Import to one
column, change the character, and then do data|Text to columns).

Option Explicit
Sub cleanEmUp()

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

myBadChars = Array(Chr(13))

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

Helena wrote:

Hi
I have created an excel worksheet from a C#-program running on a sql-server.
In my C# program there are multiline textboxes which texts are stored in the
database. Once "exported" these columns to excel, squares are displayed
before every new line in a cell.

Looking at the same excel-sheet on another persons computer with the same
excel version, the squares are not there!

Is there any way of getting rid of these, except removing them manually?
I guess it must be since the squares are not displayed on my colleage's
excel.


--

Dave Peterson