Shog9
0
Q:

excel vba HTML text with tags to formatted text in an cell

Sub TestHTML()
    Const HTML = "<html><p>This <b>bold</b> and <i>italic</i> came from HTML tags.</p></html>"
    Clipboard HTML
    [A1].PasteSpecial "Unicode Text"
End Sub


Function Clipboard$(Optional s$)
    With CreateObject("htmlfile")
    With .parentWindow.clipboardData
        Select Case True
            Case Len(s): .setData "text", s
            Case Else:   Clipboard = .GetData("text")
        End Select
    End With
    End With
End Function
3

New to Communities?

Join the community