+ Reply to Thread
Results 1 to 7 of 7

Web query for multiple webpages - shift down

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    oxford, uk
    MS-Off Ver
    Excel 2010
    Posts
    9

    Web query for multiple webpages - shift down

    Hello,

    I am trying to learn VBA as fast as I can but as you can imagine its not a small topic.
    I have cheated a little and used the above code to do a similar job as the poster.
    Please Login or Register  to view this content.
    I have a list of web pages of aircraft operators from http://www.handbook.aero/hb_charterp...?recnum=138941
    The last numbers of the pages I need vary and are in no order eg 152, 216, 1302, 1531, 2116, 138941 etc. There are hundreds.
    The beginning of the address remains the same.
    I have a list of the numbers of the pages I need but I don't know how to write the code to select each number(cell value), rather than the macro just trolling through each page in ascending order, picking out irrelevant pages along with the ones I need.
    Does this make sense to anyone?
    Any help would be appreciated.

    Tom


    MODERATOR's EDIT: This post was moved to a thread of it's own as per forum rules.

    Your post did not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread.

    If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Last edited by Paul; 09-19-2012 at 04:47 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-21-2009
    Location
    Great Britain
    MS-Off Ver
    Excel 2003
    Posts
    550

    Re: Multiple Web query from data in cells

    Which data (tables) do you want to extract? You haven't said. Also say how you want the imported data to be arranged in your workbook.

    Record a macro of you doing a web query for one of the web pages and post the code (inside [ CODE] [ /CODE] tags without the spaces) and then we can see which data you want.
    Post responsibly. Search for excelforum.com

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Web query for multiple webpages - shift down

    Assuming the list of page numbers you need are on Sheet1 column A starting at A2 and list downward, assuming nothing else is in that column...

    THis macro will make a "range" of all the cells in Sheet1 column A that have a number in them, so make sure the entries are numeric. I have also specifically targeted the destination sheet, too, so it works no matter what sheet is "active" when you start the macro:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    09-18-2012
    Location
    oxford, uk
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Multiple Web query from data in cells

    Thanks for the reply (Chippy)
    Below is the web query for the first page of data.
    All the new data needs to go into a database ideally, with each entry having its own column.
    ie,company name, aircraft used, location, tel no, email add, web add, etc
    Failing that, just as separate blocks as the query imports them, in a new sheet so I can put then into a database later.

    Is this a relatively simple thing to do?
    Please Login or Register  to view this content.
    Last edited by Paul; 09-19-2012 at 04:46 PM. Reason: Added (Chippy) since this was part of a duplicate thread merged into this one.

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Web query for multiple webpages - shift down

    Here's another way:
    Please Login or Register  to view this content.
    N.B You'll need to have headings in sheet2. I.e:

    Business Name AirFields AirCraft Operations Telephone Fax Email Website
    Last edited by Kyle123; 09-19-2012 at 12:01 PM.

  6. #6
    Registered User
    Join Date
    09-18-2012
    Location
    oxford, uk
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Web query for multiple webpages - shift down

    Thanks so much, Problem solved

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Web query for multiple webpages - shift down

    I have marked this thread solved for you.
    In the future please select Thread Tools from the menu above and mark the thread as solved. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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