|
再或者
Sub 沪深A股1()
URL = 网址同上
With CreateObject("Msxml2.XMLHTTP") 'CreateObject("Microsoft.XMLHTTP")
.Open "GET", URL, False
.Send
v = .responseText
End With
strText = Replace(Replace(Split(Split(v, "[""")(1), """]")(0), """,""", Chr(10)), ",", vbTab)
Cells.ClearContents
Call XieRu1(strText, [a2])
Row1 = Range("A65535").End(xlUp).Row
[a2] = 1: [a3] = 2: [a2:a3].AutoFill Range("a2:a" & Row1)
[a1:AA1] = Split("序号 代码 名称 昨收 今开 最新价 最高 最低 金额 总手 涨跌额 涨跌幅 均价 振幅% 委比% 委差 现手 量比 换手% 市盈率 买入 更新时间 流通股本 流通市值 流通市值")
End Sub
Public Sub XieRu1(a, R As Range)
'a:待写入数组;R:写入起始位置
Dim d As Object
Set d = New DataObject
d.SetText a
d.PutInClipboard
R.Select
ActiveSheet.Paste
Set d = Nothing
End Sub
|
|