+ Reply to Thread
Results 1 to 2 of 2

Help with multiple URLs and auto Power Queries

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Hertfordshire UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Help with multiple URLs and auto Power Queries

    Hello,

    I am looking for some help with Power Query. I have a workbook which i have been using for my Cricket teams fantasy cricket league. I used simple web query to get the information i needed from each players stats page and put into there own sheet. The URL changed each season and there are almost 100 players and thus 100 URLs. I used a simple macro to create a new query each season from a list of URLs I had on a sheet in the work book. However, Play-Cricket have changed the site and now a simple web query returns no results. I have successfully used Power Query to get the information from the site, but i cant find a way to automatically create each players own sheet from my list as i did before. I would rather lean how to achieve this so i dont have to manual do each player every season.

    An example of a URL is: http://hitchin.play-cricket.com/webs...season/2496/72

    The old macro i used was:

    Sub PlayCricket()
    '
    ' PlayCricket Macro
    '

    '

    For i = 2 To 80
    Worksheets("pc").Select
    Worksheets("pc").Activate
    mystr = "URL;http://hitchin.play-cricket.com/website/player_stats_for_season/2496/72"
    mystr = Cells(i, 1)
    Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = i
    With ActiveSheet.QueryTables.Add(Connection:=mystr, Destination:=Range("A1"))
    'CommandType = 0
    .Name = "ID"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = True
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = True
    .RefreshStyle = xlInsertEntireRows
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebSelectionType = xlSpecifiedTables
    .WebFormatting = xlWebFormattingNone
    .WebTables = "1"
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
    End With
    Next i
    End Sub

    Thank you for your time

  2. #2
    Registered User
    Join Date
    03-11-2013
    Location
    Hertfordshire UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Help with multiple URLs and auto Power Queries

    I forgot to add that i was not sure if this was in the correct forum or not. If it is not I apologise.

+ 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. Multi Web Queries from a list of URLs
    By joffy1979 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2013, 07:22 AM
  2. Need help with macro to automate web queries (with URLs in cells)
    By BBallExcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2013, 01:46 PM
  3. [SOLVED] Dynamic Web Query using Multiple URLs
    By cliff_vanderlinden in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-11-2012, 03:29 PM
  4. Excel Web Query - Multiple URLs
    By nevs in forum Excel General
    Replies: 1
    Last Post: 07-15-2011, 04:06 AM
  5. Converting text URLs to hyperlinked URLs
    By ranchhand in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2011, 01:46 PM
  6. Macro to Auto generate URLs
    By grahammc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2010, 11:46 PM
  7. Auto-filter 3 queries ?
    By opg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2009, 03:25 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