C
cyberdude
Hi,
Someone gave me the following code highlighting the block of words
ending with "test" and deleting it. I would like to modify it so that
it hightlights the block of words down to the end of the row which is
just ABOVE the word "test" and deletes that block. Could someone tell
me how to do it? Thanks.
Sub Testb()
Dim x As Long
Dim rDcm As Range
Set rDcm = Selection.Range
x = rDcm.start
rDcm.End = ActiveDocument.Range.End
With rDcm.Find
.Text = "test"
If .Execute Then
rDcm.start = x
rDcm.HighlightColorIndex = wdYellow
rDcm.Delete
End If
End With
End Sub
Mike
Someone gave me the following code highlighting the block of words
ending with "test" and deleting it. I would like to modify it so that
it hightlights the block of words down to the end of the row which is
just ABOVE the word "test" and deletes that block. Could someone tell
me how to do it? Thanks.
Sub Testb()
Dim x As Long
Dim rDcm As Range
Set rDcm = Selection.Range
x = rDcm.start
rDcm.End = ActiveDocument.Range.End
With rDcm.Find
.Text = "test"
If .Execute Then
rDcm.start = x
rDcm.HighlightColorIndex = wdYellow
rDcm.Delete
End If
End With
End Sub
Mike