View Single Post
 
Old 04-19-2017, 08:45 AM
slaycock slaycock is offline Windows 7 64bit Office 2013
Expert
 
Join Date: Sep 2013
Posts: 255
slaycock is on a distinguished road
Default

You need to make several changes

1. Remember the number of words in your original selection
2. after pasting the text move the start of the current selection backward the number of words you remembered.

Code:
Sub moveRight()
   'moveRight Macro
   
   Dim myWordsCount As Long
   
   myWordsCount = Selection.Range.Words.count
   Selection.Cut
   Selection.moveRight unit:=wdWord, count:=1
   Selection.PasteAndFormat (wdFormatOriginalFormatting)
   Selection.MoveStart unit:=wdWord, count:=-myWordsCount
   Selection.Select
End Sub
In future posts its helpful to use the Code tags (#)

Note the use of '-' in front of myWordsCount.
Reply With Quote