Is there a way to format in excel to turn the text into HTML? -
basically when enter text in excel cell, want (which centered):
weight:10 lbs
length: 21"
width: 14"
to become in cell:
<p align="center"><font size="2" face="arial"></font><br></p><p align="center"><font size="2" face="arial">weight:10lbs<br></font><span style="font-family: arial; font-size: small;">length: 21"<br>width: 14" </span></p>
i appreciate help! thank you!
the other 2 answers both valid. solution not use vba. similar john's except uses multiple instances of substitute
create new text template.
assume values in a2-c2 (this arbitrary , discretion).
template in $a$1
<p><br></p> <p align="center"><font size="2" face="arial"> {0}<br></font><span style="font-size: small;">{1}<br>{2}" </span></p>
result text
=substitute(substitute(substitute($a$1, "{0}", a2), "{1}", b2), "{2}", c2)
the advantage on method uses concatenation, can radically change order in items appear in template without having change function produces result.
even if template changed 1 below, same function using substitute
not have changed, convenient if have low of rows.
<div>{2}<table><tr><td>{0}</td><td>{1}</tr></table></div>
Comments
Post a Comment