On Sheet1 from column A row 2 downwards I have a list of URLs. I have the below code which loops through all the URLs and then it calls another macro which does stuff with the data it gets. However, I want to alter it so that each URL it loops through, it also pastes this URL onto sheet "URLs" in column A in the last used row. When the below macro starts and looks at the first URL to get data from it should only get the data if the URL is NOT contained within column A on sheet URLs.
Sub Start()
Dim i As Integer
For i = 2 To 350
Dim b As String
b = Worksheets("Sheet1").Cells(i, 1)
Sheets("SHeet2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & b, Destination:=Range("$A$1"))
.Name = _
"site.php?id=2083&brand=qf&status=RU&tipo=CALCIO&disc=CALCIO&manif=BUND_1"
.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,5,6,8,9,11,12,14,15,16"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Call DoStuffWithDataPulledFromURL
Next i
End Sub
Bookmarks