0

我想从单个网站的各种网页中自动获取数据。链接是相同的,但只是最后一个数字像这样变化: 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

我该如何自动化呢?

4

0 回答 0