2015-12-23 23 views

回答

1

要循环,你需要有做for循环像

For i = 1 to 40 
    .... 
    ... = "https://support.software.dell.com/appassure/kb?p=" & i 
    .... 
next 

(对我进口工作得很好)

我只是跑了一个快速检查站点:

Sub test() 
    Dim i As Long 
    For i = 1 To 40 
    MsgBox "get page number" & i 
    With ActiveSheet.QueryTables.Add(Connection:="URL;https://support.software.dell.com/appassure/kb?p=" & i, Destination:=Range("$A$1")) 
     .Name = "testing" 
     .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 
    Next 
End Sub 
+0

感谢您的回复 - 请您可以发布您运行的完整示例吗?我不确定如何/在哪里嵌入您的示例并输出4个必填字段。 – user3398681

+0

这真是太棒了德克 - 谢谢!我很好奇你是否知道一种方法,以便所有4个字段的标题,上次更新,视图和分级可以输出为每个字段的列(以便于排序 - 例如按最后更新或最多视图排序)? – user3398681

+0

现在,您需要运行导入的单元格并检查值......一堆工作为此创建代码...如果我再回到家中,我会研究它... –