Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
As the subject line states, I am wanting to retrieve the value between the open and closed parentheses. This is what I have so far. Thank you.
VBA Code:
Option Compare Text
Private Sub Workbook_Open()
Dim cell As Range
Dim str As String
Dim n As Long
For Each cell In Range("b2:b6")
str = cell.Value
n = InStr(str, "(")
If n = 0 Then
MsgBox "Character not found"
Else
cell.Select
MsgBox "Character found in position: " & n
MsgBox Left(str, n + 1)
End If
Next cell
End Sub