|
本帖最后由 duquancai 于 2018-6-8 20:03 编辑
kellven123 发表于 2018-6-8 11:16
请你再帮我看看,我扩充了一下代码...但是就不行了....麻烦你了..
还是A1单元格`我给你附件了 - Sub main()
- Dim js As Object, s$
- Set js = CreateObject("MSScriptControl.ScriptControl")
- js.Language = "JavaScript": js.AddObject "rg", Sheets("目的").Range("a1")
- s = Sheets("现有的").[a1]: Sheets("目的").Cells.Clear
- s = Replace(Replace(s, vbLf, "\r"), "'", "\'")
- s = "j=0;r=/<tr data-index=""\d+"">(.+?)<\/tr>/g;c=/<td[^>]+>([^<]+)<\/td>/g;while(m=r.exec('" & s & "')){j++;i=1;while(n=c.exec(m[1])){rg(j,i++)=n[1]};};"
- js.eval (s)
- MsgBox "OK!"
- End Sub
复制代码
|
|