|
▼I・O さん:
すでにmomoさんから最も適切だと思えるコードがアップされていますが
無理やり別案で2つほど。
Sub TestX()
Dim myRE As Object
Dim myText As String
Dim myPat As String
Set myRE = CreateObject("VBScript.RegExp")
myText = Range("A1").Value
With myRE
.Pattern = "■.+?■"
myText = .Replace(myText, "")
End With
MsgBox myText
Set myRE = Nothing
End Sub
Sub TestZ()
Dim myText As String
Dim n As Long
myText = Range("A1").Value
n = InStr(myText, "■")
If n > 0 Then
n = InStr(n + 1, myText, "■")
If n > 0 Then myText = Mid(myText, n + 1)
End If
MsgBox myText
End Sub
|
|