Answers for "html text with tags to formatted text in an excel cell c#"

VBA
3

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$)
    Dim v: v = s  'Cast to variant for 64-bit VBA support
    With CreateObject("htmlfile")
    With .parentWindow.clipboardData
        Select Case True
            Case Len(s): .setData "text", v
            Case Else:   Clipboard = .GetData("text")
        End Select
    End With
    End With
End Function
Posted by: Guest on May-01-2020

Code answers related to "VBA"

Browse Popular Code Answers by Language