|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 duquancai 于 2018-6-24 10:45 编辑
笨笨网络 发表于 2018-6-23 22:10
自己顶一个,有没有人能帮一下帮,谢谢了! - Sub main()
- Dim http As Object, str$, js As Object
- Set http = CreateObject("msxml2.xmlhttp")
- http.Open "GET", "https://eniu.com/xuan/stock_list.json?market%5B%5D=hsa&roe_year=avg_roe&roe=20&sort=market_value", False
- http.send
- str = http.responseText
- Set js = CreateObject("MSScriptControl.ScriptControl")
- js.Language = "JavaScript": js.AddObject "rg", Range("a1")
- str = js.eval("'" & str & "'.replace(/\\(u[0-9a-fA-F]{4})/g, '%$1');"): Cells.Clear
- js.eval ("a=" & str & ";j=1;for(k in a[0])rg(1,j++)=k;for(i=0;i<a.length;i++){j=1;for(k in a[i])rg(i+2,j++)=a[i][k];};")
- MsgBox "OK!"
- End Sub
复制代码
|
|