Function ExtractBBB(inputString As String) As String
Dim parts() As String
Dim delimiterPos As Integer
Dim beforeDelimiter As String
' 最初の空白の位置を確認
delimiterPos = InStr(1, inputString, " ", vbTextCompare)
' 空白が存在する場合、その手前の部分を抽出
If delimiterPos > 0 Then
beforeDelimiter = Left(inputString, delimiterPos - 1)
Else
beforeDelimiter = inputString
End If
' "." で分割して最後の部分を取得
parts = Split(beforeDelimiter, ".")
ExtractBBB = parts(UBound(parts))
End Function
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme