将网站的多个页面中的数据导入excel?

时间:2013-08-03 07:28:11

标签: excel import excel-web-query

我想从单个网站的各个网页自动获取数据。链接是相同的,但只是最后一个数字改变如下:http://reo-agents.net/agents/1链接保持不变只是结束编号更改到953157.因为总共有953157条记录。

我只想导入名称,电子邮件和&电话号码和格式正确就像单独的列名称,电子邮件和&手机 。我只是看到了很少的教程并进行了宏录制,但无法获得有效的解决方案。这是它的宏

Sub Macro1()
'
' Macro1 Macro
'

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://reo-agents.net/agents/1", Destination:=Range("$A$1"))
        .Name = "1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    ActiveWindow.SmallScroll Down:=21
End Sub

如何实现自动化?

0 个答案:

没有答案