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

ª½±µ§ì°£®§ªí¨ì¤u§@ªí¤¤¤£¥¿±`

  1. Sub Ä_¨Ó°£®§ªí()
  2. Application.ScreenUpdating = False   '°£Åv°£®§ªí
  3. Application.EnableEvents = False
  4. Application.DisplayStatusBar = False
  5. ActiveSheet.DisplayPageBreaks = False
  6.     Dim i As Integer, S As Integer, k As Integer, j As Integer
  7.     Dim Element
  8.       With CreateObject("InternetExplorer.Application")
  9.         '.Visible = True           '¥iÅã¥Üºô­¶
  10.        .Navigate "http://jdata.yuanta.com.tw/z/ze/zeb/zeb.djhtm"
  11.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  12.         Set Element = .Document.getElementsByTagName("table")(2) ' ¤w§ä¥Xºô­¶ªºtable¤º®e¦b 0-3 ¤¤
  13.         Sheets("sheet1").Cells.ClearContents
  14.         With Sheets("sheet1")
  15.             For i = 1 To Element.Rows.Length - 1
  16.                 For j = 0 To Element.Rows(i).Cells.Length - 1
  17.                     If j = 0 And i > 2 Then
  18.                         .Cells(i, j + 1) = Element.all.tags("a")(i - 3).innertext
  19.                     Else
  20.                         .Cells(i, j + 1) = Element.Rows(i).Cells(j).innertext
  21.                     End If
  22.                 Next
  23.             Next
  24.         End With
  25.        .Quit
  26.     End With
  27.     Set Element = Nothing
  28.    
  29. Application.DisplayStatusBar = True
  30. End Sub
½Æ»s¥N½X
¦^´_ 1# t8899
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ®É®É¦n¤ß´N¬O®É®É¦n¤é¡C
ªð¦^¦Cªí ¤W¤@¥DÃD