I have the following:
Sub Web_Query()
Dim wsWQ As Worksheet
Dim rCell As Range
Set wsWQ = Sheet1
For Each rCell In Sheet2.Range("C2", Sheet2.Cells(Sheet2.Rows.Count, "C").End(xlUp))
With wsWQ.QueryTables.Add(Connection:= _
"URL;http://hitchin.play-cricket.com/scoreboard/individualPerformanceResults.asp?seasonID=26&userID=" & rCell & "&ruleTypeID=6101", _
Destination:=wsWQ.Cells(wsWQ.Rows.Count, "A").End(xlUp)(2, 1))
.Name = "ID_1"
.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 = "3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next rCell
End Sub
As you can see I reference C2 from sheet2, i would like to add a name found in the correspondinghttps://www.google.co.uk/search?cli...a=X&ei=0DOdUab_GuaN0AXWhIH4AQ&ved=0CCwQvwUoAA cell in coloumn B to column O (A to N are taken from the result of the query) in sheet1 (which holds the result of the above macro). So i would like the above Sub to run the web query from a list of URLs, and for the corresponding name to be added with the results of the above query in column O.
Any help would be great
Sub Web_Query()
Dim wsWQ As Worksheet
Dim rCell As Range
Set wsWQ = Sheet1
For Each rCell In Sheet2.Range("C2", Sheet2.Cells(Sheet2.Rows.Count, "C").End(xlUp))
With wsWQ.QueryTables.Add(Connection:= _
"URL;http://hitchin.play-cricket.com/scoreboard/individualPerformanceResults.asp?seasonID=26&userID=" & rCell & "&ruleTypeID=6101", _
Destination:=wsWQ.Cells(wsWQ.Rows.Count, "A").End(xlUp)(2, 1))
.Name = "ID_1"
.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 = "3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next rCell
End Sub
As you can see I reference C2 from sheet2, i would like to add a name found in the correspondinghttps://www.google.co.uk/search?cli...a=X&ei=0DOdUab_GuaN0AXWhIH4AQ&ved=0CCwQvwUoAA cell in coloumn B to column O (A to N are taken from the result of the query) in sheet1 (which holds the result of the above macro). So i would like the above Sub to run the web query from a list of URLs, and for the corresponding name to be added with the results of the above query in column O.
Any help would be great
