Excel TRIM() can't handle   in pasted HTML

D

dyt

Has anyone seen this kind of misbehavior?

1. Create a table in HTML like:
<table><tr>
<td align="right" nowrap>214,074&nbsp;</td>
<td align="right" nowrap>55,859&nbsp;</td>
<td align="right" nowrap>26.09&nbsp;</td>
<td align="right" nowrap>267,102&nbsp;</td>
<td align="right" nowrap>71,365&nbsp;</td>
<td align="right" nowrap>26.72&nbsp;</td>
</tr></table>
(this is actually created by a very silly application
we bought)

2. Display it in your favorite browser
3. Copy it into an Excel spreadsheet
4. try to trim() or value() any of the values to get a
number. Doesn't work! What works is '=value(a1,len(a1)-
1)

!!!!
 
B

Bob Phillips

=substitute(a1,CHAR(160),"")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
F

Fredrik Wahlgren

dyt said:
Has anyone seen this kind of misbehavior?

1. Create a table in HTML like:
<table><tr>
<td align="right" nowrap>214,074&nbsp;</td>
<td align="right" nowrap>55,859&nbsp;</td>
<td align="right" nowrap>26.09&nbsp;</td>
<td align="right" nowrap>267,102&nbsp;</td>
<td align="right" nowrap>71,365&nbsp;</td>
<td align="right" nowrap>26.72&nbsp;</td>
</tr></table>
(this is actually created by a very silly application
we bought)

2. Display it in your favorite browser
3. Copy it into an Excel spreadsheet
4. try to trim() or value() any of the values to get a
number. Doesn't work! What works is '=value(a1,len(a1)-
1)

!!!!

Why not simply open the html page in notepad and do a find and replace on
&nbsp?

/Fredrik
 

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

Top