I'd appreciate any help I can get. Thanks!
What I am trying to accomplish:
I have a list of websites in column B of my "Links" tab. (The # of links may vary)
I want to export data from each website in a loop into cell B1 in my "Results" tab
I want to paste the resulting summary info into my "Summary" tab. Cells A2:AK3 contain the information and i want to paste the results starting in cell A5 on my Summary tab and for each new website, paste 2 rows below where I previously pasted the info.
The code I have now is the begginning of what I think I need to do. I am getting an error in the ".Refresh BackgroundQuery:=False" line of code.
Sub Loops()
Dim i As Long
For i = 3 To Cells(Rows.Count, "B").End(xlUp).Row
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:="URL;" & Range("$B$" & i).Value, Destination:=Range("$B$1"))
.Name = Range("B" & i).Value
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2,3,7"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next i
Bookmarks