I would like to know how to use VBA script to covert a whole column of cells with html tags to formatted text (based on those tags).
I was able to convert ONE cell based on a previous listing: HTML Text with tags to formatted text in an Excel cell
Using the following:
Sub Sample() Dim Ie As Object Set Ie = CreateObject("InternetExplorer.Application") With Ie .Visible = False .Navigate "about:blank" .document.body.InnerHTML = Sheets("Sheet1").Range("A1").Value 'update to the cell that contains HTML you want converted .ExecWB 17, 0 'Select all contents in browser .ExecWB 12, 2 'Copy them ActiveSheet.Paste Destination:=Sheets("Sheet1").Range("B1") 'update to cell you want converted HTML pasted in .Quit End With End Sub
But this only converts the first cell in the column. (In the example above, I manually typed in A2 and B2 to do the second cell as well). I'm sorry if this is a naive question, but I'm new to VBA. I've tried to use loops and play with ranges, but unsuccessfully.