Closed Thread
Results 1 to 8 of 8

Web Query - Import data from multiple pages into a single MS Excel worksheet.

  1. #1
    Registered User
    Join Date
    11-12-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    8

    Web Query - Import data from multiple pages into a single MS Excel worksheet.

    If a website contains data in a single page, we can extract the same using Excel 2007 'import from web' feature under 'data' button. Can we do the same if the data runs to several pages ? Example. I want to know the cricket scores of various batsmen, match-wise and Cricinfo gives the same in 55 pages under the following URLs:

    ODI Batting
    Page1
    http://stats.espncricinfo.com/ci/eng...ppertype=print
    Page 2
    http://stats.espncricinfo.com/ci/eng...ppertype=print
    Page 3
    http://stats.espncricinfo.com/ci/eng...ppertype=print
    Page 55
    http://stats.espncricinfo.com/ci/eng...ppertype=print
    How do I take such a huge data into a single excel sheet ?
    Thanks for help. I am learning excel.

  2. #2
    Registered User
    Join Date
    11-12-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    I think I have reached a certain position with the following code.
    ___________________________________________________________
    Please Login or Register  to view this content.
    ____________________________________________________________
    Now to get bowling data, I have gone by the following code:

    Please Login or Register  to view this content.
    ________________________________________________________
    The 2nd macro is not working. Debug shows defect in the following line:

    Please Login or Register  to view this content.
    Any help possible ?
    Last edited by Cutter; 07-13-2012 at 07:51 AM. Reason: Added code tags

  3. #3
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    Please include URL; in the Curl Variable before the exact URL. Plus, also supply
    Please Login or Register  to view this content.
    instead of just Range.

    Worked for me.

    Thanks,
    Vikas B

    PS, always use code tags whenever you post any code in the forum.

  4. #4
    Registered User
    Join Date
    11-12-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    Thanks, my friend. It has worked. I am learning macros.

  5. #5
    Registered User
    Join Date
    11-12-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    Couple of issues in the above examples:

    1) when the first macro is run, it generated 10,978 rows. But when the second macro is run, it generated 11,110 rows. I feel both of them should have same number of rows. Is there a flaw in these macros ?

    2) Macros are unable to generate one continuous excel sheet. Each part of data is separated by a row containing a first cell (such as A1) having the word "Innings by Innings list". The next row again is a blank row with titles appearing (such as player, etc). Can we eliminate rows containing these two words so that all the data will appear in one range ?

  6. #6
    Registered User
    Join Date
    11-12-2010
    Location
    Dubai
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    On close observation of data I got, I see that all the sheets have not been imported. Surprised. Any problem in the code ?

  7. #7
    Registered User
    Join Date
    03-22-2009
    Location
    Gujarat,India
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    Working fine but pages not contain the internal link

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,371

    Re: Web Query - Import data from multiple pages into a single MS Excel worksheet.

    This is an old thread. If you wish to follow up anything in it, please start your own (new) thread explaining your issue and add a link back to this one.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1