Log in

View Full Version : Varying Find Next Macro



Iangarlock
06-20-2013, 10:52 AM
Is there a macro code that will find the next occurrence of a selected text AND also vary depending on the text I have highlighted? (In other words, I want to be able to highlight a selected test, run the macro and it will find the next occurrence of that selected text.):help

gmaxey
06-20-2013, 05:37 PM
Here is one fish:

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
oRng.Start = Selection.Range.End
With oRng.Find
.Text = Selection.Text
If .Execute Then
oRng.Select
End If
End With
End Sub