Html code for formatting text4/27/2023 ![]() ![]() ![]() ' Adds converts text formatted with basic HTML tags to formatted text in an Excel cell Hope others find this useful: Public Sub AddHTMLFormattedText(rngA As Range, strHTML As String, Optional blnShowBadHTMLWarning As Boolean = False) Ultimately, I came up with a routine that'll handle simple tags and not use the "native" Unicode converter that is causing the issue with merged fields. I tried a few tweaks (unmerge/remerge, etc.) but then Excel dropped anything below a break, so that was a dead end. I was disappointed that Excel doesn't let us paste to a merged cell and also pastes results containing a break into successive rows below the "target" cell though, as that meant it simply doesn't work for me. Private Sub Worksheet_Change(ByVal Target As Range, ByVal sht As Worksheet)ĭim objData As DataObject ' Set a reference to MS Forms 2.0 Note, if your innerHTML is all numbers eg '12345', HTML formattingĭosen't fully work in excel as it treats number differently? but add a character egĪ trailing space at the end eg. Anyway this should be faster than starting If the IE example doesn't work use this one. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |