ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

³]°j°é

§Aªºµ{¦¡½X¬O¤£¬O¨S¦³½Æ»s§¹¾ã  «ç»ò·|¨S¦³²Ä¤@¦æ "sub"
¤j®a¤¬¬ÛÀ°¦£¸Ñ¨M°ÝÃD,¤~·|¶i¨B

TOP

¦^´_ 1# 518587
  1. Sub test1()

  2.     Dim a As String           '³]©waÅܼƬ°¦r¦ê
  3.     Dim i As Integer          '¶]°j°é
  4.    
  5.     For i = 2 To 6            '¶]¦^°é  ¦]¬°§A¦³¤­­Óºô§}   ©Ò¥H¬O±q2¶]¨ì6 ¤­¦¸

  6.         a = Worksheets("¤u§@ªí2").Range("B" & i)   'i=2 ¬OB2  ¥H¦¹Ãþ±À B3   B4   B5   B6
  7.         
  8.         With ActiveSheet.QueryTables.Add(Connection:= _
  9.             "URL;http://www.atpworldtour.com/Tennis/Players/Ac/R/Ricardo-Acioly.aspx", _
  10.             Destination:=Range("$A$1"))   '¥H¤Uºô§}¬O§A´£¨Ñ  ´N¤£¸Ñ»¡
  11.             .Name = "Ricardo-Acioly"
  12.             .FieldNames = True
  13.             .RowNumbers = False
  14.             .FillAdjacentFormulas = False
  15.             .PreserveFormatting = True
  16.             .RefreshOnFileOpen = False
  17.             .BackgroundQuery = True
  18.             .RefreshStyle = xlInsertDeleteCells
  19.             .SavePassword = False
  20.             .SaveData = True
  21.             .AdjustColumnWidth = True
  22.             .RefreshPeriod = 0
  23.             .WebSelectionType = xlEntirePage
  24.             .WebFormatting = xlWebFormattingNone
  25.             .WebPreFormattedTextToColumns = True
  26.             .WebConsecutiveDelimitersAsOne = True
  27.             .WebSingleBlockTextImport = False
  28.             .WebDisableDateRecognition = False
  29.             .WebDisableRedirections = False
  30.             .Refresh BackgroundQuery:=False
  31.         End With
  32.     Next i
  33. End Sub
½Æ»s¥N½X
°j°é1test.rar (15.56 KB)
¤j®a¤¬¬ÛÀ°¦£¸Ñ¨M°ÝÃD,¤~·|¶i¨B

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD