View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Quin Quin is offline
external usenet poster
 
Posts: 37
Default Very Simple formatting Question

Ron,

Your post was very helpful. Your guess was right about imported data from
the web. It turns out that there were non-printing characters in the cells
that prevented normal formatting and sorting behavior.

I tried all your suggestions. IsText() function returns TRUE. So yes, even
though I format as currency, Excel continues to treat the data as text.

The Edit/PasteSpecial/Add suggestion did not work.

The Trim function you suggested does work but I found another helpful
procedure. When I Googled "Excel Non-Printing Characters" Here is that
solution...

START QUOTE FROM http://www.icehouse.net/jim_d/excel3.html

TO REMOVE NON-PRINTING CHARACTERS:

Select one of the problem cells.
Press F2 to Edit the cell.
Press End to move the blinking insertion point to the end of the cell
contents.
Hold down Shift and press the Left-arrow key once, to select/highlight the
last character in the cell.
Copy that character to the Clipboard. (You may then need to press Esc a
couple of times to get out of Edit mode.)
Select all the cells with the problem data in them.
From the menus, do Edit, Replace; click in Find What and Paste in your
invisible mystery character from the Clipboard. Leave Replace With blank.
Click Replace All.

END QUOTE

The site quoted above has lots of information on this. I also used the
LEN() function to discover the length of the data in the cells. In my case
length was longer than the visible characters. I also used CODE(RIGHT()) to
discover non-printing characters CHAR(160) to the right.

Ultimately I repaired my sheet with find and replace as described in the
procedure above. I also learned something about hidden characters.

Thanks for your help,

Quin