Import data from multiple pages of a website into an Excel workbook

  • I want to download data from multiple pages of this website .
    only the date changes in the link .
    I want to download Result calender from 07-01-2014 to 25-04-2015
    here is the link http://www.moneycontrol.com/earnings...014-01-07.html
    Is it possible to have month wise sheets in the excel workbook.


    I have created this macro ,but it fetches data for specific date only.How do I make changes to it to down load data from say 1/4/2015 till current day .
    previous day url can be accessed by changing date in url


  • Re: Import data from multiple pages of a website into an Excel workbook


    Try this:

  • Re: Import data from multiple pages of a website into an Excel workbook


    SLASH729 try this:

  • Re: Import data from multiple pages of a website into an Excel workbook


    Quote from John_w;794637

    SLASH729 try this:


    Thanks John_w its working ,I want little change in the code how do I download data for particular period like the previous code where I made changes in dates
    For resultsDate = DateValue("1-Apr-2015") To Date

  • Re: Import data from multiple pages of a website into an Excel workbook


    My code extracts all the available results. The earliest result date is 6-Apr-2017. AFAICS there aren't any results for dates in 2015 or 2016. If you want to restrict the imported data to a specific date or range of dates then you could filter the data in Excel.

  • Re: Import data from multiple pages of a website into an Excel workbook


    Quote from John_w;794849

    My code extracts all the available results. The earliest result date is 6-Apr-2017. AFAICS there aren't any results for dates in 2015 or 2016. If you want to restrict the imported data to a specific date or range of dates then you could filter the data in Excel.


    ok got it thanks
    I download data from this site regularly.so same data for a date I will be downloading regularly.say I download data on 15 july 2017,it will include all data from 6 april 2017 ,which I have already have so what should I do if I want to download data between 1 july 2017 to 15 july 2017


    thanks for your help

  • Re: Import data from multiple pages of a website into an Excel workbook


    Quote from SLASH729;794972

    what should I do if I want to download data between 1 july 2017 to 15 july 2017

    There is nothing on the web page which allows you to specify a range of dates for the data you want to download. Therefore my macro above downloads all the available data - all the pages - and you would have to filter the data within Excel to restrict it a range of dates. The following macro does that - sorts and filters the data on Sheet1 between start and end dates and copies the filtered data to Sheet2.


  • Re: Import data from multiple pages of a website into an Excel workbook


    thanks ,and how do I write the date ?
    01-07-2017
    01/07/2017
    I have tried many types :)

    Quote from John_w;796169

    There is nothing on the web page which allows you to specify a range of dates for the data you want to download. Therefore my macro above downloads all the available data - all the pages - and you would have to filter the data within Excel to restrict it a range of dates. The following macro does that - sorts and filters the data on Sheet1 between start and end dates and copies the filtered data to Sheet2.


  • Re: Import data from multiple pages of a website into an Excel workbook


    You can enter the date in any recognised regional format, and the VBA code above should correctly translate it into an Excel date.


    For dd/mm/yyyy region dates, any of these formats should work: 23/7/17, 23-07-17, 23-Jul-2017, etc.


    For mm/dd/yyyy region dates, any of these formats should work: 7/23/17, 07-23-17, Jul-23-2017, etc.


    Remember, the filtered data is written to Sheet2.