|
修改一位老师的代码,名字不记得啦!请见谅!
因网址上不去,未经调试,请您自己测试!
- Sub yzc51()
- Set objXML = New XMLHTTP30
- Application.ScreenUpdating = False
- Cells.ClearContents
- URL = "http://money.finance.sina.com.cn/quotes_service/api/json_v2.php/Market_Center.getHQNodeData?num=2000&sort=symbol&asc=1&node=sz_a&page=1"
- For l = 1 To 2
-
- If l = 2 Then URL = "http://money.finance.sina.com.cn/quotes_service/api/json_v2.php/Market_Center.getHQNodeData?num=2000&sort=symbol&asc=1&node=sh_a&page=1"
- With objXML
- .Open "GET", URL, False
- .send
- txtCon = .responseText
- End With
-
- txtCon1 = Replace(txtCon, """", "")
- txtCon1 = Replace(txtCon1, "}]", "")
- arr = Split(txtCon1, "},{")
- For j = 0 To UBound(arr)
- Cells(jj + j + 2, 1) = j + 1 + jj
- arr1 = Split(arr(j), ",")
- For i = 1 To 19
- Cells(jj + j + 2, i + 1) = Mid(arr1(i), InStr(1, arr1(i), ":") + 1)
- Next i
- Next j
- jj = j
- Next l
-
- [a1:t1] = Split("序号 代码 名称 最新价 涨跌额 涨跌幅 买入 卖出 昨收 今开 最高 最低 成交量/手 成交额/万 更新时间 市盈率 市净率 总市值 流通市值 换手率")
-
- Application.ScreenUpdating = True
- Set objXML = Nothing
- End Sub
复制代码 |
|