View Single Post
  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AFSSkier AFSSkier is offline
external usenet poster
 
Posts: 94
Default With a Function, how can I get rid of formating codes like <di

Glen,

It's not always same. They are random formating codes from random
comments/memos.

Here's an example of the most complexed, (my comments).

<div<font face=Arial size=2KRAFT</div (hard return)
<divReport: Item Performance</div (hard return)
<div& n b s p ;(<=no spaces)</div (hard return)
<divrewrite table & a m p ;(<=no spaces) queries.</div

--
Thanks, Kevin


"Glenn" wrote:

AFSSkier wrote:
I have a refreshable spreadsheet with data imported from Access. When the
data imports, I get Access formatting codes like <div, &nbsp and font codes
(see below). I doing want the end user to have to do a search & replace a
blank, even with a macro. It only happens with memo/comment fields coming
from Access.

<div<font face=Arial size=2 color="#006666"PBA data. (ALL VERSIONS
INCLUDING MONTANA)</font</div <div </div

In an adjacent cell I want to use a function(s) to format the new cell to
look like this = PBA data. ;(ALL VERSIONS INCLUDING MONTANA)



Try this:

=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("</",A1)-1),"",REPT(" ",9999)),9999))

Makes the assumption that your actual data is all in one chunk and will always
start after a "" and end before the first "</". If that's not always true, or
if there is "" or "</" within your data, then you will need to pursue more
complex solutions.