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

³]°j°é

³]°j°é

§Ú·Q­n±q²Ä¤@­Óºô§}¶×¤J¥~³¡¸ê®Æ¡B²Ä¤G­Óºô§}¶×¤J¥~³¡¸ê®Æ.....¨ì²Ä¤­­Ó¡A½Ð°Ý§Ú¸Ó¦p¦ó³]¥ß¤@­Ó°j°é?
°j°é.rar (7.53 KB)
¥H¤U¬O§Ú¶×¤Jªº²Ä¤@­Óºô§}ªº¥~³¡¸ê®Æ
  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
½Æ»s¥N½X

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

TOP

¦^´_ 2# ³\·ç²»


    ¹ï!!! ÁÙ¯Ê
  1. Sub ¥¨¶°1()
  2. '
  3. ' ¥¨¶°1 ¥¨¶°
  4. '
  5. ' §Ö³tÁä: Ctrl+q
½Æ»s¥N½X

TOP

§Ú·Q­n±q²Ä¤@­Óºô§}¶×¤J¥~³¡¸ê®Æ¡B²Ä¤G­Óºô§}¶×¤J¥~³¡¸ê®Æ.....¨ì²Ä¤­­Ó¡A½Ð°Ý§Ú¸Ó¦p¦ó³]¥ß¤@­Ó°j°é?

¥H ...
518587 µoªí©ó 2014-10-20 17:25

Sub nn()
' Â^¨úºô¸ô¸ê®Æ
Dim lRows

lRows = 2
Do While Cells(lRows, 2) <> ""

    Range("C3").Select
    ActiveCell.FormulaR1C1 = Cells(lRows, 2)
    Sheets("Â^¨ú¸ê®Æ").Select
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;" & Cells(lRows, 2), _
...
    End With
Loop
End Sub

TOP

¦^´_ 4# luhpro


    ½Ð°Ý¤j¤j¯à§_¸Ô²Ó»¡©ú¤@¤U ¦]¬°§Ú­è¤Jªù ÁÙ¤£¤ÓÀ´ ·PÁÂ

TOP

¦^´_ 5# 518587
Dim lRows ' ©w¸q lRows ÅܼÆ, °µ°j°é¤¤¦C¸¹ÅܰʨϥÎ
lRows = 2 ' ±q²Ä2¦C¶}©l§ìºô§}
Do While Cells(lRows, 2) <> "" ' Do °j°é¶}©l, While ²Å¦X«á­±±ø¥ó´NÄ~Äò°õ¦æ°j°é, Cells(¦C¸¹=lRows, Ä渹=2)  Àx¦s®æªí¥Ü¤è¦¡, <>"" Àx¦s®æ¤º®e¤£µ¥©óªÅ¦r¦ê
    Range("C3").Select
    ActiveCell.FormulaR1C1 = Cells(lRows, 2) ' ºô§}¥ÎÀx¦s®æ¤º®e¨ú¥N, ¦] lRows ·|»¼¼W, ©Ò¥H¨C¦¸°j°é§ìªººô§}³£¤£¦P
    Sheets("Â^¨ú¸ê®Æ").Select
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;" & Cells(lRows, 2), _ '   "URL;ºô§}"  §ï¬°  "URL;" & Àx¦s®æ¤º®e(§Yºô§}), & ¬°¦r¦ê³s±µ¨Ï¥Î¦r¤¸
...
    End With
lRows = lRows + 1 ' ½Ð¥[¤W³o¦æ,¤W­±§Ñ¤F¥[, ©êºp.  lRows ¨C¦¸ÅÜ°Ê¥[ 1 , §Y ²Ä 2 ¦C ->  ²Ä 3 ¦C -> ...
Loop ' °j°éµ²§ô

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 : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD