- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-7 06:45 ½s¿è
¦^´_ 21# t8899 - Option Explicit
- Private Sub Ex()
- Dim xlVbTable As Object, Ar, R As Integer, C As Integer, i As Variant, Y As Integer
- Dim t As Date, Msg As Boolean
- ' Application.OnTime Time + #12:01:00 AM#, "Ex" '¤@¤ÀÄÁ«á°õ¦æ Ex µ{¦¡
- Application.OnTime Time + #12:01:00 AM#, "SHEET5.Ex" '¤@¤ÀÄÁ«á°õ¦æ Ex µ{¦¡
- 'µ{¦¡¦bª«¥ó¼Ò²Õ¤¤n«ü©ú¼Ò²Õ¦WºÙ , Private Sub(¨p¥Îµ{¦¡)¦b¤@¯ë¼Ò²Õ¤¤¤]n«ü©ú ¤@¯ë¼Ò²Õ¦WºÙ
- Application.DisplayStatusBar = True 'Åã¥Üª¬ºA¦C
- t = Time
- With CreateObject("InternetExplorer.Application")
- ' .Visible = True
- .Navigate "http://udn.megatime.com.tw/asp/hot/ShortOperate.asp?lcount=20&m=puplim&align=v"
- Do While (.Busy Or .ReadyState <> 4) And Msg = False
- DoEvents
- If Time > t + #12:00:05 AM# Then Msg = True
- Loop
- If Msg = True Then
- .Quit
- 'MsgBox "³s½uªº®É¶¡¶W¹L5¬í"
- Application.StatusBar = "³s½u¥¢±Ñ ³s½uªº®É¶¡¶W¹L5¬í"
- Else
- Set xlVbTable = .document.getelementsbytagname("table")
- On Error Resume Next
- With Sheets("Sheet5")
- .Cells = ""
- .Cells(1, 1) = "º¦°±ÂꦺªÑ"
- For Each i In Array(20, 24)
- If i = 24 Then .Cells(1, "J") = "¶^°±ÂꦺªÑ"
- Y = 2
- For R = 0 To xlVbTable(i).Rows.Length - 1
- For C = 0 To xlVbTable(i).Rows(1).ALL.Length - 1
- .Cells(Y, C + IIf(i = 20, 1, 10)) = xlVbTable(i).Rows(R).Cells(C).innerText
- 'IIf(i = 20, 1, 10) -> 1:="A", 10:="J"
- Next
- Y = Y + 1
- Next
- If i = 20 Then .Rows(13).Delete '¶K¤W³sµ²ªºÀx¦s®æ¤´µM¬O#REF!->Àx¦s®æ³Q§R°£±¼
- Next
- End With
- .Quit
- Sheets("Sheet3").[I4:I22] = "=SHEET5!RC[-6]" '¶K¤W³sµ²ªºÀx¦s®æ¤´
- 'MsgBox Application.Text(Time - t, "¶O®É [ss] ¬í")
- Application.StatusBar = "³s½u¦¨¥\ §ó·s®É¶¡ " & Format(Time, "HH:MM:SS")
- End If
- End With
- End Sub
½Æ»s¥N½X |
|