i am trying to download all archive links from the excel archive but my have a problem with the following macro
i want to be able to change the x on the following line
"URL;http://www.mrexcel.com/forum/archive/index.php/f-10-p-x.html"
so i the macro can loop from 1 to 5 in this example
Rich (BB code):
Sub MrexcelArchive()
'
' MrexcelArchive2 Macro
' www.mrexcel/forum/archive
Dim LastRow As Object
Dim x As Integer
Set LastRow = Range("A" & Rows.Count).End(xlUp)
For x = 1 To 5
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.mrexcel.com/forum/archive/index.php/f-10-p-x.html", _
Destination:=LastRow.Offset(2, 0))
.Name = "MrExcelArchive"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Next x
End Sub
"URL;http://www.mrexcel.com/forum/archive/index.php/f-10-p-x.html"
so i the macro can loop from 1 to 5 in this example