|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
正则提取天气预报信息- Sub ykcbf() '//2024.8.8 正则提取天气预报信息
- Set reg = CreateObject("VBScript.Regexp")
- With reg
- .Global = True
- .IgnoreCase = True
- .Pattern = "ymd:'(.*?)',bWendu:'(.*?)',yWendu:'(.*?)',tianqi:'(.*?)'"
- End With
- st = [j1].Value
- ReDim brr(1 To 10000, 1 To 4)
- Set mh = reg.Execute(st)
- For Each k In mh
- m = m + 1
- For x = 1 To 4
- brr(m, x) = k.submatches(x - 1)
- Next
- Next
- [a2:d10000] = ""
- [a2].Resize(m, 4) = brr
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|