Consulting

Results 1 to 3 of 3

Thread: Import data from a web page to Excel

  1. #1
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location

    Import data from a web page to Excel

    Still working on my KB Search, is there a way to get the data from the KB List into my spreadsheet automatically (getting right out of my depth here!)

    PS. Finally figured out these clever links as well.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Try this Malcolm

    Option Explicit
    
    Sub gethtmltable()
    Dim objWeb As QueryTable
    Set objWeb = ActiveSheet.QueryTables.Add( _
    Connection:="URL;http://www.vbaexpress.com/kb/kblist.php", _
    Destination:=Range("A1"))
    With objWeb
    .WebSelectionType = xlSpecifiedTables
        .WebTables = "12" ' Identify your HTML Table here
        .Refresh BackgroundQuery:=False
        .SaveData = True
    End With
    End Sub
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Thanks Steve,
    Exactly what I was after.
    Regards
    Malcolm
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •