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

[µo°Ý] §ì¨úºô­¶¸ê®Æ(¼u¥X¦¡µøµ¡)

¦^´_ 1# PKKO

  1. Sub ex1()

  2.     For i = 1 To 30
  3.      
  4.         Cells(i, 4) = Len(Cells(i, 3))
  5.         Cells(i, 5) = InStr(Cells(i, 3), "(")
  6.         Cells(i, 6) = InStr(Cells(i, 3), ")")
  7.         Cells(i, 7) = Mid(Cells(i, 3), Cells(i, 5) + 2, Cells(i, 6) - Cells(i, 5) - 3) '¤½¥q¥N½X

  8.         snum = Cells(i, 7)
  9.         Set HTML = CreateObject("htmlfile")
  10.         
  11.         Dim strText As String
  12.         With CreateObject("WinHttp.WinHttpRequest.5.1")
  13.             .Open "get", "http://www.travel.org.tw/showtable.aspx?id=" & snum, False
  14.             .Send
  15.             strText = .responseText
  16.             
  17.             HTML.body.innerhtml = strText
  18.             Set tb = HTML.all.tags("table")(0).Rows
  19.             
  20.             For x = 1 To 13
  21.                 Cells(i, x + 7) = tb(x).Cells(1).innertext
  22.             Next
  23.         End With

  24.     Next
  25.         
  26.     Cells.EntireColumn.AutoFit
  27. End Sub
½Æ»s¥N½X
test.zip (27.6 KB)

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD