- ©«¤l
- 759
- ¥DÃD
- 249
- ºëµØ
- 0
- ¿n¤À
- 1021
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 11
- ³nÅ骩¥»
- OFFICE2021
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-5-30
- ³Ì«áµn¿ý
- 2024-11-22
|
¦^´_ t8899
¤@ª½¥X²{"ok"°T®§µøµ¡?? §A¬O¤¤¾Ç¥ÍÀ³¸Ó·|Ãö³¬³o"ok"µøµ¡.¦³°ÝÃD¸ÕµÛ¦Û¤v¸Ñ¨M,VBA¤~·|¶i¨B. ...
GBKEE µoªí©ó 2014-1-14 13:50
§Ú§ï¤F¤@¤U¡A¬O§_¸ò³o¦³Ãö??(¬õ¦â³¡¥÷)
Sub timestock()
Application.ScreenUpdating = False
Dim i As Integer, S As Integer, K As Integer, j As Integer
Dim Element
With CreateObject("InternetExplorer.Application")
'.Visible = True '¥iÅã¥Üºô¶
.Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
Set Element = .document.getelementsbytagname("table")
With Sheets("SHEET5")
' .Cells.Clear
.Range("A1:F17").ClearContents
'For s = 0 To element.Length - 1 '¤£ª¾¦¹ºô¶ªºtable¤º®e:½Ð¥ý¦æ´ú¸Õºô¶ªº§¹¾ãtable¤º®e
For S = 2 To 3 '¤w§ä¥Xºô¶ªºtable¤º®e¦b 0-3 ¤¤
For i = 0 To Element(S).Rows.Length - 1
K = K + 1
' For j = 0 To Element(S).Rows(i).Cells.Length - 1 '¸ê®ÆªºÄæ¦ì¦@6¦ì
j=2
.Cells(K, j + 1) = Element(S).Rows(i).Cells(j).innerText
Next
' Next
Next
' .Cells.EntireColumn.AutoFit '¦Û°Ê½Õ¾ãÄæ¼e
' .Cells.EntireRow.AutoFit '¦Û°Ê½Õ¾ã¦C°ª
End With
.Quit
End With
Set Element = Nothing
' MsgBox "0K"
End Sub |
|