- 帖子
- 154
- 主題
- 1
- 精華
- 0
- 積分
- 200
- 點名
- 1
- 作業系統
- windwos 7
- 軟體版本
- 64bit
- 閱讀權限
- 20
- 註冊時間
- 2017-5-29
- 最後登錄
- 2025-1-1
|
3#
發表於 2021-7-15 13:52
| 只看該作者
本帖最後由 quickfixer 於 2021-7-15 14:02 編輯
回復 1# vuptp6
執行test
Sub test()
Dim getxml As Object, url As String, temp, t As Double
t = Timer
Set getxml = CreateObject("msxml2.xmlhttp")
url = "https://fubon-ebrokerdj.fbs.com.tw/Z/ZC/ZCL/CZCL3.DJBCD?A=2330&B=Y"
getxml.Open "GET", url, False
getxml.send
temp = Split(getxml.responsetext, " ")
Application.ScreenUpdating = False
Cells.Clear
For i = 1 To 5
Call col(i, Split(temp(Choose(i, 0, 5, 6, 2, 3)), ","))
Next i
Set getxml = Nothing
Range("f1") = Timer - t & "秒"
Application.ScreenUpdating = True
End Sub
Sub col(c, temp)
r = 1
For j = UBound(temp) To 0 Step -1
r = r + 1
If c = 1 Then Cells(r, c) = "'" & temp(j) Else Cells(r, c) = temp(j)
Next j
End Sub |
|