本帖最后由 Kaohsing 于 2018-9-7 10:39 编辑
如果格式是这样:(这些数据好像是彩票类数据)
那代码就是这样:
- Private Sub CommandButton1_Click()
- Dim js As Object, s$, json$
- s = "[{""ttery"":""b10"",""issue"":""1702084"",""code"":""01,05,02,07,10,09,06,08,04,03"",""code1"":null,""code2"":null,""time"":1536046966000},{""ttery"":""b10"",""issue"":""1702084"",""code"":""01,05,02,07,10,09,06,08,04,03"",""code1"":null,""code2"":null,""time"":1536046966000}]"
- Set js = CreateObject("MSScriptControl.ScriptControl")
- js.Language = "JavaScript": js.AddObject "g", Range("a27")
- json = "a=" & s & ";for(i=0;i<a.length;i++){g(i+1,1)=a[i].issue;g(i+1,2)=a[i].code.split(',').join(' ')};"
- js.eval (json)
-
- End Sub
复制代码
|