Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import HTML code into Excel
Hello guys,
Does anybody have any idea how can I pick html code from a webpage, and paste into excel, line by line? The link from the webpage is a variable, so I will get the information right from the web. All I need is that: Excel picks up the variable "link"; Get the html code from the "link" url, and place, line by line into Excel as TEXT. Could anybody help me?? PLEAAASSSE :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import HTML code into Excel
Hi josuegm,
josuegm wrote: Does anybody have any idea how can I pick html code from a webpage, and paste into excel, line by line? The link from the webpage is a variable, so I will get the information right from the web. All I need is that: Excel picks up the variable "link"; Get the html code from the "link" url, and place, line by line into Excel as TEXT. This should work: Public Function gsGetHTML(rsURL As String) As String Dim x As Object Set x = CreateObject("Microsoft.XMLHTTP") With x .Open "GET", rsURL .send Do Until .ReadyState = 4 DoEvents Loop gsGetHTML = .ResponseText End With Set x = Nothing End Function Sub Demo() Dim sHTML As String Dim vHTML As Variant Dim lRow As Long sHTML = gsGetHTML(Range("A1").Value) vHTML = Split(sHTML, vbCrLf) For lRow = 2 To UBound(vHTML) + 2 Cells(lRow, 1).Value = vHTML(lRow - 2) Next lRow End Sub Just put a URL in A1 and execute Demo(). There's no error handling, so you may want to add some in (or at least check the validity of the URL). -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import HTML code into Excel
Thanks man! Worked perfectly!!!
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I import raw HTML source code into Excel? | Excel Programming | |||
How to import html file in excel 2007 | Excel Discussion (Misc queries) | |||
auto import a table into excel from a html | Excel Programming | |||
Import HTML code from a text file. | Excel Programming | |||
HTML TAGS that format Data for import into Excel | Excel Programming |