本帖最后由 兮洋夕夏 于 2023-12-18 13:30 编辑
Sub 快乐8更新()
' Application.ScreenUpdating = False
Dim i&, j&, arr()
Dim s() As String
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "https://data.917500.cn/kl81000_asc.txt", False
.Send
s = Split(.responseText, Chr(10))
End With
List = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
ReDim arr(1 To UBound(s) * 8, 1 To 22)
For i = 0 To UBound(s) - 1
For j = 1 To 22
arr(i * 1 + 1, j) = Split(s(i), " ")(List(j - 1))
Next j
Next i
Cells(4, 1).Resize(10000, 22).ClearContents
Cells(4, 1).Resize(UBound(arr), 22).Value = arr
End Sub