View Single Post
  #1   Report Post  
Steved
 
Posts: n/a
Default To goto end of document

Hello from Steved

Please how do I write a macro for the below to go to the
next and so on until it reaches the end of the document.

Dim s As String
Dim p As Integer
Selection.Paragraphs(1).Range.Select
s = Selection.Text
p = InStr(1, s, " ") ' position of 1st space
p = InStr(p + 1, s, " ") ' position of 2nd space
s = Right(s, Len(s) - p) ' text right of position
Selection.Paragraphs(1).Range.Text = s

Thankyou.