|
こんな感じでしょーか ?
Sub Rep_MyText()
Dim objRE As Object, Matches As Object
Dim MyR As Range, C As Range
Dim CkSt As String
Dim Pt As Integer
Set MyR = Range("A:A").SpecialCells(2)
MyR.Replace "円", ""
Set objRE = CreateObject("VBScript.RegExp")
With objRE
.Pattern = "\d"
.Global = True
End With
For Each C In MyR
CkSt = C.Text
If objRE.Test(CkSt) Then
Set Matches = objRE.Execute(CkSt)
Pt = Matches(0).FirstIndex + 1
C.Characters(Pt, 0).Insert "\"
Set Matches = Nothing
End If
Next
Set objRE = Nothing: Set MyR = Nothing
End Sub
*実行してみると分かるけど・・
大工用具\112505656ホームセンター
なんて結果が出ますよ。了解してるならいいけど。
|
|