Quantcast
Channel: OKWAVE 最新質問(Visual Basic/257)【本日】
Viewing all articles
Browse latest Browse all 6510

vbaで正規表現

$
0
0
正規表現のコードなんですが、 上手く動きません。 何故でしょうか… Sub Test() Dim reg As Object Dim ans As Object Dim c As Range         Set reg = CreateObject("VBScript.RegExp")     For Each c In Range("A1", Range("A" & Rows.Count).End(xlUp))             With reg             .Pattern = "^【[(1)-(20)](\d*/\d*)"             Set ans = .Execute(c.Value)         End With                 If ans > 0 Then             If Len(ans(0).submatches(0)) > 0 Then                             Debug.Print c.Address & "|" & ans(0).submatches(0)                             End If         End If             Next     End Sub

Viewing all articles
Browse latest Browse all 6510

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>