PBMax
asked on
Macro to Convert Excel Cell to HTML and preserve font formatting.
Is there a macro freely available that can convert a cell in excel to HTML and retain it's font formatting? I only care about bolds, underlines, colors, and line breaks. I don't want to export the whole excel document to HTML just specific cells. I have a program that takes an excel document as it's input but only formats based on HTML and all excel formatting of text is lost. If I can convert it with a macro I can retain the formatting.
I.E.
Excel Cell:
"
bolded text and underlined text
regular text
"
HTML:
"
<b>bolded text</b> and <i>underlined text</i>r<br>
regular text
"
I could write a macro myself that will search each character for the .FONT format and but figured that something was already written and save some time and effort.
I.E.
Excel Cell:
"
bolded text and underlined text
regular text
"
HTML:
"
<b>bolded text</b> and <i>underlined text</i>r<br>
regular text
"
I could write a macro myself that will search each character for the .FONT format and but figured that something was already written and save some time and effort.
ASKER
Thanks Psychotec for the comment but I found that script already. That script will export the cell with formatting only if the WHOLE cell has the formatting applied. If you only bold a particular word the code does not work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://charlie.balch.org/hdoc/exceltohtml.html
See first sentence:
"The macros below convert an Excel range to a HTML Table. Most formating, including merged cells, bold, italic and many colors are preserved"
good luck