Sub getSubString()
Dim InParens As String, NoParens As String, total As String
Dim leftParens As Integer, rightParens As Integer
total = "Some Sample Text (SST)"
leftParens = InStr(total, "(")
rightParens = InStr(total, ")")
difference = rightParens - leftParens - 1
InParens = Mid$(total, (leftParens + 1), difference)
NoParens = Replace(total, "(" & InParens & ")", "")
MsgBox (InParens & vbCrLf & vbCrLf & NoParens)
End Sub
|