Import HTML table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone show me some code to import an HTML table from a webpage. I
curious if it is possible to import the data between <TABLE> tags in the html
source.
 
how about using a Web Query:

ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/actives?e=o",
Destination:=Range("A1"))
.Name = "actives?e=o"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

Look at help on "WebTables" and .WebSelectionType = xlSpecifiedTables


http://office.microsoft.com/en-us/assistance/HA010450851033.aspx

http://www.vertex42.com/News/excel-web-query.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top