- ©«¤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 ©ó 2018-9-3 16:27 ½s¿è
¦^´_ 1# Scott090
¨S¹ê»Ú°õ¦æ¾ã¤Ñ¦æ±¡¹L,½Ð¦Û¦æ´ú¸Õ- Option Explicit
- Sub EX() 'Àɮ׶}±Ò®É½Ð«ü©w°õ¦æ¦¹µ{¦¡
- If Time < #9:00:00 AM# Then
- Application.OnTime #9:00:00 AM#, "Ex_yahoo"
- ElseIf Time <= #2:30:00 PM# Then
- Ex_yahoo
- End If
- End Sub
- Sub Ex_yahoo()
- Dim oXmlhttp As Object, oHtmldoc As Object, E As Object
- Dim R As Integer, RR As Integer, C As Integer, xTime As Double
- If Time <= #2:30:00 PM# Then Application.OnTime #12:05:00 AM#, "Ex_yahoo" '5¤ÀÄÁ«á¦A«×°õ¦æ
- Set oXmlhttp = CreateObject("msxml2.xmlhttp")
- Set oHtmldoc = CreateObject("htmlfile")
- With oXmlhttp
- .Open "Get", "https://tw.stock.yahoo.com/q/ts?s=2330&t=50", False
- .Send
- oHtmldoc.write .responseText
- End With
- With Sheets("¤u§@ªí1")
- Set E = oHtmldoc.all.tags("table")(6)
- If .[a1] <> E.Rows(0).Cells(0).innertext & "-" & E.Rows(0).Cells(1).innertext Then
- .Cells.Clear
- .[a1] = E.Rows(0).Cells(0).innertext & "-" & E.Rows(0).Cells(1).innertext
- End If
- Set E = oHtmldoc.all.tags("table")(7)
- If .[a2] = "" Then
- For C = 0 To E.Rows(0).Cells.Length - 1
- .Cells(2, C + 1) = E.Rows(0).Cells(C).innertext
- Next
- End If
- For R = E.Rows.Length - 1 To 1 Step -1
- xTime = TimeValue(E.Rows(R).Cells(0).innertext)
- If IsError(Application.Match(xTime, .[A:A], 0)) Then
- RR = Application.CountA(.[A:A]) + 1
- For C = 0 To E.Rows(R).Cells.Length - 1
- .Cells(RR, C + 1) = E.Rows(R).Cells(C).innertext
- Next
- End If
- Next
- End With
- Set oXmlhttp = Nothing
- Set oHtmldoc = Nothing
-
- End Sub
½Æ»s¥N½X |
|