返回列表 上一主題 發帖

設迴圈

設迴圈

我想要從第一個網址匯入外部資料、第二個網址匯入外部資料.....到第五個,請問我該如何設立一個迴圈?
迴圈.rar (7.53 KB)
以下是我匯入的第一個網址的外部資料
  1. ' 擷取網路資料

  2.     Range("C3").Select
  3.     ActiveCell.FormulaR1C1 = _
  4.         "http://www.atpworldtour.com/Tennis/Players/Ac/R/Ricardo-Acioly.aspx"
  5.     Sheets("擷取資料").Select
  6.     Range("A1").Select
  7.     With ActiveSheet.QueryTables.Add(Connection:= _
  8.         "URL;http://www.atpworldtour.com/Tennis/Players/Ac/R/Ricardo-Acioly.aspx", _
  9.         Destination:=Range("$A$1"))
  10.         .Name = "Ricardo-Acioly"
  11.         .FieldNames = True
  12.         .RowNumbers = False
  13.         .FillAdjacentFormulas = False
  14.         .PreserveFormatting = True
  15.         .RefreshOnFileOpen = False
  16.         .BackgroundQuery = True
  17.         .RefreshStyle = xlInsertDeleteCells
  18.         .SavePassword = False
  19.         .SaveData = True
  20.         .AdjustColumnWidth = True
  21.         .RefreshPeriod = 0
  22.         .WebSelectionType = xlEntirePage
  23.         .WebFormatting = xlWebFormattingNone
  24.         .WebPreFormattedTextToColumns = True
  25.         .WebConsecutiveDelimitersAsOne = True
  26.         .WebSingleBlockTextImport = False
  27.         .WebDisableDateRecognition = False
  28.         .WebDisableRedirections = False
  29.         .Refresh BackgroundQuery:=False
  30.     End With
複製代碼

回復 2# 許瑞祥


    對!!! 還缺
  1. Sub 巨集1()
  2. '
  3. ' 巨集1 巨集
  4. '
  5. ' 快速鍵: Ctrl+q
複製代碼

TOP

回復 4# luhpro


    請問大大能否詳細說明一下 因為我剛入門 還不太懂 感謝

TOP

        靜思自在 : 口說一句好話,如口出蓮花;口說一句壞話如口吐毒蛇。
返回列表 上一主題