View Single Post
 
Old 11-11-2018, 03:56 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The display HAS to change because you are moving a paragraph where the cursor is sitting to another location but you don't need to move the cursor.
Code:
Sub Move_To_Next_Monday()
  Dim oRng As Range, oSel As Range
  Set oSel = Selection.Range.Paragraphs(1).Range
  Set oRng = ActiveDocument.Range
  oRng.Start = oSel.End
  If oRng.Find.Execute("~Monday") Then
    oRng.Start = oRng.Paragraphs(1).Range.End
    oRng.FormattedText = oSel.FormattedText
    oSel.Delete
  End If

lbl_Exit:
  Set oRng = Nothing
  Set oSel = Nothing
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote