Consulting

Results 1 to 2 of 2

Thread: Macro to loop through Web Queries and enact a second macro once each page loads

  1. #1
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location

    Macro to loop through Web Queries and enact a second macro once each page loads

    In the attachment, sheet 'Races' has a table of Venue&Race No.'s in col D. In cols E & F is a manually entered list of Web Query parameters for a separate web page per row. There can be quite a few! At the top in cell D2 is a dropdown, whereby I manually select a race , the vlookups in cells E2 & F2 look up the parameters. As each race is selected the web query refreshes and loads a new page that appears on Sheet5. There is a 'button' here that I press (I use a split screen view) and the macro 'Getslections', (a Leith special) produces the selections in Sheet5 col B.

    This is extremely time consuming, as a page takes about 5-6 secs to load. What would be good , would be a macro button located on sheet 'Races', that loops through each race D8, D9, D10...., the page loads, the 'GetSlections' macro fires and the selections get posted horizontally in sheet 'Races' col's $H8:$?8 adjacent to each race. basically where the web addresses are now (not needed). These selections are then transferred manually copied and pasted to an excel bot.

    Thanks for your interest.
    Attached Files Attached Files

  2. #2
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    OK, that was a doozie of an assignment, so I'll reduce my expectations a little. I would like a macro, fired by a button on Sheet1, that finds a match in cells D8, D9, D10... to $D$2. If found, copy and paste cell range $H$2:$L$2 adjacent to found row (in this instance range(H11:L11)). Cell $D$2 is everchanging, so the button will be pressed each time to run the macro, to populate the H:L columns.
    Cheers
    Attached Files Attached Files

Posting Permissions

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