VBAで正規表現を使って全角英数を半角英数に変換する
Public Function ConvWideToNarrow(ByVal s As String)
Dim re, Match, Matches
Dim strPat As String
Dim strTest As String
Set re = CreateObject("VBScript.RegExp")
strTest = s
strPat = "[0-9|a-z]"
With re
.Pattern = strPat
.IgnoreCase = True
.Global = True
End With
Set Matches = re.Execute(strTest)
For Each Match In Matches
strTest = Replace(strTest, Match.Value, StrConv(Match.Value, vbNarrow))
Next
ConvWideToNarrow = strTest
End Function
同じ文字に対する置換を複数回行なっていたり、改善の余地ありですね。微妙にパフォーマンス良くないと思います。