+ Reply to Thread
Results 1 to 8 of 8

Web query from cell value

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Web query from cell value

    Hi

    I want to pull in some results from a web query but change the date by entering the date of the query in a cell (ae1) from the following url and refresh destination cell A1

    http://www.paddypower.com/results/mu...ate=2017-04-10

    Is this possible with a macro or similar? I have googled it and can't get any of the solutions to work

    Thanks
    Last edited by hazzaska; 04-22-2017 at 05:01 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Web query from cell value

    Hi !

    Maybe ! 'cause I can't access this site, I got a Restricted Territory Message !

    A must read : Web Scraping tutorial

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Web query from cell value

    Here is similar thread you could follow.
    https://www.excelforum.com/excel-pro...ml#post4634797

    if you want auto fresh, you need to use excel's import function to import it as a table.

  4. #4
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Web query from cell value

    I have got it to work with a macro but how do i overwrite the populated cells and not add a new connection everytime?

    HTML Code: 
    Last edited by hazzaska; 04-22-2017 at 06:43 AM.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Web query from cell value

    Please wrap your code before I post the code.

    This is the correct code, but there is an issue with dates. The code loops from B2 to down column B and pick up the dates for each loop.

    I put all dates in column B, but these dates are not recognised as dates and thus get a wrong table.
    I still looking at it.

    Please Login or Register  to view this content.
    Last edited by AB33; 04-22-2017 at 07:08 AM.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Web query from cell value

    When I convert the dates in column B to text (which should match the dates in the site), it seems to work.

  7. #7
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Web query from cell value

    Hi i cant seem to get that to work, my macro works but adds a new connection and also pastes into adjacent columns not A1 can my macro be edited to just overwrite the data populated in a1 etc?

    Thanks

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Web query from cell value

    I do not know what do you mean by "adds a new connection". The code does not paste in A1, each loop (Table) is pasted into next empty row in column A. Where do you want to paste the imported table? If you want to delete the connection:

    ActiveWorkbook.Connections(1).Delete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Web query where url is in a cell
    By Mulberry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2013, 01:48 AM
  2. Replies: 2
    Last Post: 02-01-2013, 04:21 PM
  3. web query cell changes
    By spursrule68 in forum Excel General
    Replies: 0
    Last Post: 05-31-2012, 07:34 AM
  4. Web Query - Change a word in query to form a new query
    By scottymelloty in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2011, 04:13 AM
  5. Web Query through URL in Cell
    By Unibot in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-01-2009, 08:53 PM
  6. cell value query
    By ada in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-18-2007, 09:34 PM
  7. [SOLVED] Cell value for Query
    By CLR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2006, 03:10 PM

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