I am not a VBA developer, however due to the nature of my issue, i need to turn to it.
Background, i am trying to download my data to excel. My DB raw data, contains HTML codes eg.
<h2>HTML Links</h2>
<p>HTML links are defined with the a tag:</p>
<a href="https://www.w3schools.com">This is a link</a>
I had somehow, thru the power of copying and pasting from the internet, almost achieve what i wanted. My main reference, is from this thread,
html-text-with-tags
Sub Sample()
Dim Ie As Object
Set Ie = CreateObject("InternetExplorer.Application")
With Ie
.Visible = False
.Navigate "about:blank"
.document.body.InnerHTML = Sheets("Sheet1").Range("I9").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("J2")
'update to cell you want converted HTML pasted in
.Quit
End With
End Sub
This is what happen when i execute the codes,
What i really want, is that the formatted text, will all appear in cell J2. I’m guessing it is because of the line breaks in the message in I9
What should i do?
Thank you.