Hi all,

Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+a
'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://abcd.com/Second.asp?code=00000022", _
        Destination:=Range("$A$1"))
        .CommandType = 0
        .Name = "Second.asp?code=00000022"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "6"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
End Sub
I want to add a loop in the above web query so that i could get the data from all the 1000 webpages into excel. Also tweak the macro if there are any unwanted lines in the recorded macro.

"URL;http://abcd.com/Second.asp?code=00000022" ( Code range = 00000001 TO 00001000 )

.Name = "Second.asp?code=00000022" ( Code range = 00000001 TO 00001000 )

Destination:=Range("$A$1")) ( The data from each webpage should get copied in the same sheet finding the next blank cell in Range (A1).


Kindly help me.

Regards,

Zaska