special character in Worksheet column after import

  • Thread starter Thread starter Martin Glodde
  • Start date Start date
M

Martin Glodde

Hi,
I imported some text files that have two columns of numeric values.
Those seem to have a fixed width, but after the import, there appears to
be a special character in the second column that is sometimes indicated
by an open/white square i.e., it cannot be displayed.
Surprisingly, this square is only displayed in my older XP 2002 (for
students and teachers) at home, but not in the newer Office 2003 version
on my work laptop. There, I was puzzling why Excel didn't want to plot a
graph from my table. At home, I realized that the special character not
shown at work was the reason.
First of all: can I make it happen that this special character (or its
replacement, the square) is also shown in newer Excel versions? How?
Also, is there any trick at the stage of the text file import that
allows me to see whether or not there is such a character, so that I can
exclude it?

Thanks,
Martin
 
Can you high light and copy just that character into another cell, then use
this

=CODE(B2)

assuming you put it into cell B2

it might be a good chance the result is 10

do ctrl + H, click in find what and
hold down alt while typing 010 on the numpad
then release the alt key, in the replace with box put a space or leave empty
then
replace all

if that doesn't work you can use a macro

Sub Clean_Carriage_Return()
Selection.Replace What:=Chr(10), _
Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub


select the range and run the macro, if you get 13 when you test it replace
the Chr(10) with Chr(13)

on how to install a macro

http://www.mvps.org/dmcritchie/excel/install.htm
-

Regards,

Peo Sjoblom

Northwest Excel Solutions

www.nwexcelsolutions.com

(remove ^^ from email address)

Portland, Oregon
 
Thanks, Peo.

Peo said:
Can you high light and copy just that character into another cell, then
use this

=CODE(B2)

It's infact a tab chr(9), which leaves the question why this didn't show
up when I imported the data.
Sub Clean_Carriage_Return()
Selection.Replace What:=Chr(10), _
Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub

I installed the modified macro, using chr(9) instead of 10. However,
when I run it on highlighted cells, I end up with ########## ; so sth.
must have happened that makes this cell illegal. Any idea?
The same happens if I use the replace option as suggested.

Martin
 
It could mean a few things.

1. The columnwidth is too narrow to show the number.

Widen the column or change the font size of that cell. Or change the
numberformat to General.

2. You have a date/time in that cell and it's negative

Don't use negative dates. If excel was helping you, it may have
changed the format to a date. Change it back to General (or some
other number format).

If you need to see negative date/times:
Tools|options|Calculation Tab|and check 1904 date system
(but this can cause trouble--watch what happens to your dates
and watch what happens when you copy|paste dates to a different
workbook that doesn't use this setting)

3. You have a lot of text in the cell, the cell is formatted as Text.

Format the cell as general.

4. You really have ###'s in that cell.

Clean up that cell.

5. You have # in a cell, but it's format is set to Fill.

Change the format
(format|cells|alignment tab|horizontal box, change it to General.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top