D
dejones923
I have an established range in a table. In that range there is verbiage
surrounded by parenthesis like (abc) (defghi) (jklm) etc. I would like to
select each instance in the range to do something with it before going to the
next row.
Can anyone help with this.
Sub GetVerbiage()
Dim totCount As Integer, i As Integer, myVerbiage As String,
rngToSearch As Range, rngResult As Range, intRow As Integer
totCount = ActiveDocument.Tables(23).Rows.Count
For i = 14 To totCount
Set rngToSearch =
ActiveDocument.Tables(23).Rows(i).Cells(7).Range
Set rngResult = rngToSearch.Duplicate
With rngResult.Find
.ClearFormatting
.Text = "\(*\)"
.Forward = True
.MatchWildcards = True
.Wrap = wdFindContinue
.Execute
End With
If rngResult.Find.Found Then
'do something here
End If
'At this point there is other verbiage in the range that I
would like to look at and maybe do something with it but the code jumps
to the next i. How do I get it to look at the next instance where there is
verbiage surronded by parenthesis like (Now is the time1) (Now is the time2)'
Next i
End Sub
surrounded by parenthesis like (abc) (defghi) (jklm) etc. I would like to
select each instance in the range to do something with it before going to the
next row.
Can anyone help with this.
Sub GetVerbiage()
Dim totCount As Integer, i As Integer, myVerbiage As String,
rngToSearch As Range, rngResult As Range, intRow As Integer
totCount = ActiveDocument.Tables(23).Rows.Count
For i = 14 To totCount
Set rngToSearch =
ActiveDocument.Tables(23).Rows(i).Cells(7).Range
Set rngResult = rngToSearch.Duplicate
With rngResult.Find
.ClearFormatting
.Text = "\(*\)"
.Forward = True
.MatchWildcards = True
.Wrap = wdFindContinue
.Execute
End With
If rngResult.Find.Found Then
'do something here
End If
'At this point there is other verbiage in the range that I
would like to look at and maybe do something with it but the code jumps
to the next i. How do I get it to look at the next instance where there is
verbiage surronded by parenthesis like (Now is the time1) (Now is the time2)'
Next i
End Sub