Get web page data into Excel using VBA

Please login in order to report media.

  • Uploaded 8 months ago in the category How to programming

    Our Excel training videos on YouTube cover formulas, functions and VBA.

    Useful for beginners as well as advanced learners.

    New upload every Thursday.
    For details you can visit our website:
    http://www.exceltrainingvideos.com/complete-automation-of-getting-web-page-data-into-excel-worksheet-using-vba/
    In this video we show the complete automation of how to get data into an Excel worksheet using VBA.
    1.

    We first study the website and find out the elements we'll need to access a form and the subsequent results.

    When you study the web page's HTML source code you'll note that the actual results are wrapped up in DIV containers.

    2.

    Next we write the VBA code
    We use the getElementById method to get a reference to a single object and the getElementsByTagName method to get a collection of all the elements.

    Next we loop through all the elements and get the text properties or data ('innertext') of all the elements we wish to have.
    Our code instantiates our web browser (Internet Explorer) and navigates to the URL of our choice and then helps to get or extract the data using events.
    We also ensure that the code is placed in appropriate columns and rows so that any further analysis is made easy.
    Finally we use a recorded macro to format the data to make it more presentable to the human eye.
    You can view the complete code at: http://www.exceltrainingvideos.com/complete-automation-of-getting-web-page-data-into-excel-worksheet-using-vba/

    Interesting Links:
    http://www.tushar-mehta.com/publish_train/xl_vba_cases/vba_web_pages_services/index.htm

    http://officevbavsto-en.blogspot.com.br/2012/06/vba-internet-acessing-web-pages-through_15.html?m=1

    Get the book Excel 2016 Power Programming with VBA: http://amzn.to/2kDP35V
    If you are from India you can get this book here: http://amzn.to/2jzJGqU

  • getwebpagedataexcelvba