次の VBA 関数は、あなたが求めていることを理解しているようです。
Function stripThree(s As String)
' find any sequence of three "digits"
' that are separated by either ' ', '*', or '/'
' and remove them, including their leading separator
Dim ii, l, lastGood, lastSep As Integer
Dim retval As String
lastGood = 0
lastSep = 0
For ii = 1 To Len(s)
l = Mid(s, ii, 1)
retval = retval & l
If l = "/" Or l = "*" Or l = " " Then
If ii - lastSep = 4 Then
retval = Left(retval, Len(retval) - 5) & l
End If
lastSep = ii
End If
Next ii
' if last "separator" is the end of the string
' we still need to remove the three digit/letter code
If lastSep + 4 = ii Then
retval = Left(retval, Len(retval) - 4)
End If
stripThree = retval
End Function
作業中のこのコードの例:
input: D11F2/J3C2/FENCE*25A/23A/21A/20A
output: D11F2/J3C2/FENCE
input: d11f2/00A/123/d6f2
output: d11f2/d6f2
質問に規定されているとおりです。